1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-10-30 23:58:09 +02:00

docs: generate static/releases.json (#1594)

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2020-06-08 16:48:10 -03:00
committed by GitHub
parent de71c2ada7
commit df73ead056
3 changed files with 28 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@ goreleaser
debug.test
snap.login
site/
www/docs/static/releases.json

View File

@@ -59,6 +59,12 @@ serve:
@docker run --rm -it -p 8000:8000 -v ${PWD}/www:/docs squidfunk/mkdocs-material
.PHONY: serve
vercel:
./scripts/get-releases.sh
pip install mkdocs-material mkdocs-minify-plugin
cd www
mkdocs build
# Show to-do items per file.
todo:
@grep \

21
scripts/get-releases.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
url="https://api.github.com/repos/goreleaser/goreleaser/releases"
get_last_page() {
curl -sf -I -H "Authorization: Bearer $GITHUB_TOKEN" \
"$url" |
grep -E '^Link: ' |
sed -e 's/^Link:.*page=//g' -e 's/>.*$//g'
}
last_page="$(get_last_page)"
tmp="$(mktemp -d)"
for i in $(seq 1 "$last_page"); do
echo "page: $i"
curl -H "Authorization: Bearer $GITHUB_TOKEN" -sf "$url?page=$i" >"$tmp/$i.json"
done
jq '[inputs] | add' "$tmp"/*.json >www/docs/static/releases.json