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

CI: Use 'gh release' to upload assets to release #3187

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

seisman
Copy link
Member

@seisman seisman commented Apr 21, 2024

Description of proposed changes

Use gh release to upload assets to release, so we don't need to use the shogo82148/actions-upload-release-asset action anymore.

Reference: https://michael-mckenna.com/how-to-upload-file-to-github-release-in-a-workflow/

The same commit was pushed to my own fork (https://github.com/seisman/pygmt). See https://github.com/seisman/pygmt/actions/runs/8772441014 for the workflow run and the testing release https://github.com/seisman/pygmt/releases/tag/v0.12.0.

@seisman seisman added maintenance Boring but important stuff for the core devs final review call This PR requires final review and approval from a second reviewer labels Apr 21, 2024
@seisman seisman added this to the 0.12.0 milestone Apr 21, 2024
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: baseline-images.zip
run: gh release upload ${{ github.ref_name }} baseline-images.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blog post you linked uses github.event.release.tag_name instead of github.ref_name. I had a look at https://docs.github.com/en/actions/learn-github-actions/contexts#github-context, and I suppose they're the same for tags (e.g. v0.12.0), but I suppose github.ref_name would be safer if we need to re-run the workflow, say if the dvc pull step failed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just triggered another run of the workflow in my own fork (https://github.com/seisman/pygmt/actions/runs/8772441014/job/24079741738).

  gh release upload v0.12.0 baseline-images.zip
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***

github.ref_name is v0.12.0 for the manually triggered run. I guess github.ref_name is better.

@seisman seisman merged commit 11a1bc1 into main Apr 22, 2024
8 checks passed
@seisman seisman deleted the ci/release-assets branch April 22, 2024 00:51
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants