Skip to content

Commit

Permalink
Alt.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanhorn committed Nov 12, 2024
1 parent 5bd4f68 commit 6aa2edd
Showing 1 changed file with 8 additions and 41 deletions.
49 changes: 8 additions & 41 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,15 @@ jobs:
# raco pkg install --auto www/
raco make www/main.scrbl
make -C www main
- name: Generate assignment zips
env:
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/cmsc430/assignments/actions/workflows/push.yml/dispatches \
-d '{"ref":"main"}'
- name: Get zips run ID
env:
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
run: |
sleep 60 # give chance to finish
response=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/cmsc430/assignments/actions/runs?branch=main&status=success&per_page=1")
echo "Run response: $response"
run_id=$(echo "$response" | jq -r '.workflow_runs[0].id')
echo "RUN_ID=$run_id" >> $GITHUB_ENV
- name: Download assignment zips
env:
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
run: |
response=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/cmsc430/assignments/actions/runs/${{ env.RUN_ID }}/artifacts)
echo "Run response: $response"
download_url=$(echo "$response" | jq -r '.artifacts[0].archive_download_url')
echo "Download URL: $download_url"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
$download_url \
-o artifacts.zip
- name: Extract assignment zips
run: |
unzip artifacts.zip
tar -xvf artifact.tar
mv knock-plus.zip www/main/code/
uses: Legit-Labs/action-download-artifact@v2
with:
github_token: ${{ secrets.PAT_ZIPS_WORKFLOW }}
workflow: push.yml
workflow_conclusion: success
branch: main
name: zips
path: www/main/code
- name: Archive www
uses: actions/upload-pages-artifact@v3
with:
Expand Down

0 comments on commit 6aa2edd

Please sign in to comment.