Skip to content

Commit

Permalink
Minimize output
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Oct 26, 2023
1 parent b8a5ea6 commit 6e8b329
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/update-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Install jq
uses: dcarbone/[email protected]
with:
force: true
- name: Create index
run: |
set -euxo pipefail
gh api --paginate repos/leanprover/lean4/releases > releases
gh api --paginate repos/leanprover/lean4-nightly/releases > releases-nightly
mkdir output
jq -s '{version: "1", stable: .[0] | map(select(.prerelease | not)), beta: .[0] | map(select(.prerelease)), nightly: .[1]}' releases releases-nightly > output/index.json
jq --compact-output --slurp '
def preprocess: map(pick(.name, .created_at, (.assets | .[] | .name, .browser_download_url)));
{version: "1", stable: .[0] | map(select(.prerelease | not)) | preprocess, beta: .[0] | map(select(.prerelease)) | preprocess, nightly: .[1] | preprocess}' \
releases releases-nightly > output/index.json
- name: Create artifact
uses: actions/upload-pages-artifact@v2
with:
Expand Down

0 comments on commit 6e8b329

Please sign in to comment.