Skip to content

Commit 5f84729

Browse files
Copilotpelikhan
andauthored
ci: upload gh-aw binary from build job as artifact with download instructions (#21440)
* Initial plan * Upload gh-aw binary artifact in build job (already implemented) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * ci: add step summary with binary download instructions for gh cli and curl Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent bc8c7f8 commit 5f84729

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,32 @@ jobs:
557557
path: gh-aw
558558
retention-days: 14
559559

560+
- name: Report binary download instructions
561+
run: |
562+
RUN_ID="${{ github.run_id }}"
563+
REPO="${{ github.repository }}"
564+
echo "## 📦 gh-aw Binary" >> $GITHUB_STEP_SUMMARY
565+
echo "" >> $GITHUB_STEP_SUMMARY
566+
echo "The \`gh-aw\` Linux (amd64) binary has been uploaded as an artifact." >> $GITHUB_STEP_SUMMARY
567+
echo "" >> $GITHUB_STEP_SUMMARY
568+
echo "### Download with GitHub CLI" >> $GITHUB_STEP_SUMMARY
569+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
570+
echo "gh run download ${RUN_ID} --repo ${REPO} --name gh-aw-linux-amd64" >> $GITHUB_STEP_SUMMARY
571+
echo "chmod +x gh-aw" >> $GITHUB_STEP_SUMMARY
572+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
573+
echo "" >> $GITHUB_STEP_SUMMARY
574+
echo "### Download with curl" >> $GITHUB_STEP_SUMMARY
575+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
576+
echo "# Requires a GitHub token with actions:read scope" >> $GITHUB_STEP_SUMMARY
577+
echo "ARTIFACT_ID=\$(curl -fsSL -H \"Authorization: Bearer \$GH_TOKEN\" \\" >> $GITHUB_STEP_SUMMARY
578+
echo " \"https://api.github.com/repos/${REPO}/actions/runs/${RUN_ID}/artifacts\" \\" >> $GITHUB_STEP_SUMMARY
579+
echo " | jq -r '.artifacts[] | select(.name==\"gh-aw-linux-amd64\") | .id')" >> $GITHUB_STEP_SUMMARY
580+
echo "curl -fsSL -H \"Authorization: Bearer \$GH_TOKEN\" \\" >> $GITHUB_STEP_SUMMARY
581+
echo " -L \"https://api.github.com/repos/${REPO}/actions/artifacts/\$ARTIFACT_ID/zip\" \\" >> $GITHUB_STEP_SUMMARY
582+
echo " -o gh-aw-linux-amd64.zip" >> $GITHUB_STEP_SUMMARY
583+
echo "unzip gh-aw-linux-amd64.zip && chmod +x gh-aw" >> $GITHUB_STEP_SUMMARY
584+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
585+
560586
- name: Rebuild lock files
561587
run: make recompile
562588
env:

0 commit comments

Comments
 (0)