Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Improve static-builds.yml on pull_request (Add link to artifacts) #475

Closed
erikmd opened this issue Mar 6, 2022 · 1 comment · Fixed by #501, #486 or ocaml/opam-repository#22877
Assignees
Labels
kind: feature New user-facing feature.

Comments

@erikmd
Copy link
Member

erikmd commented Mar 6, 2022

Related project scope(s): GHA and PRs

The problem

The artifacts' URL is not easy to find.

(except at release time, of course)

Wanted solution

  • Add a step in static-builds.yml
  • using bash / curl commands or so
  • to append links in PR's status summary for the 7 artifacts: {learn-ocaml-client,learn-ocaml,learn-ocaml-server}×{linux,darwin},
    and the zip archive.

Additional context

@erikmd
Copy link
Member Author

erikmd commented Nov 25, 2022

Algo (given ocaml-sf/learn-ocaml is a public repo):

curl \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" \
| jq '[.artifacts | .[] | {"id": .id, "name": .name, "up": .updated_at, "exp": .expires_at, "dl_fyi": .archive_download_url}]'

# curl -D -  \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer $TOKEN" \  # (PAC, public repo)
# "$dl_fyi"

curl \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/ocaml-sf/learn-ocaml/actions/runs/${{ github.run_id }}" \
| jq '.check_suite_id'

echo https://github.com/ocaml-sf/learn-ocaml/suites/$suite_id/artifacts/$art_id

echo Status description: name; should login to download the github artifact; timestamps with `date` rendering

Use https://docs.github.com/en/rest/commits/statuses#create-a-commit-status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment