Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GHA workflow structure to match other repos (`workflow-dispatc…
…h`, NodeJS 12 actions, etc.) (#6) * Upgrade actions/upload-artifact According to these changelogs: https://github.com/actions/upload-artifact/releases/tag/v3.0.0 https://github.com/actions/upload-artifact/releases/tag/v3.1.1 This should address the Github Actions warnings about upgrading from node12 to node16, and about not using `set-output`. * Don't make files world-writable * Upgrade actions/download-artifact This involves a change of behavior: https://github.com/actions/download-artifact#compatibility-between-v1-and-v2v3 Namely, artifacts are now downloaded to the current directory by default, instead of creating a (redundant, in our case) directory with the artifact name. * Remove trailing whitespace * Upgrade from actions/create-release to ncipollo/release-action The README for actions/create-release mentions that it's currently unmaintained, and points to some alternatives, including ncipollo/release-action, which we use in other projects already. The API is different, so this means changing how the parameters are specified for the action, but it seems like a fairly straightforward match. The bonus is that ncipollo/release-action allows attaching artifacts directly, which means: * The three steps with actions/download-artifact have to happen earlier; * The three steps with actions/upload-release-asset (which is also an archived, unmaintained action) don't need to happen at all; and * No other steps refer to the `create_release` step id, so it can be removed. * `pb.yml`: Copy `on:` from `sct_tutorial_data` (`workflow-dispatch`) It looks like before this commit, we would automatically run the workflow and create the release for _any_ changes whatsoever. Then, we would pick one of those automatically-created releases and rename it to the desired release title. (Perhaps this workflow was first developed before `workflow-dispatch` even existed?) In other repos, though, we follow a "don't automatically create releases, only create releases when manually run" sort of workflow. And, given that `sct_tutorial_data` follows a similar pattern (generate artifacts, upload them to a release), I figure we can follow its example here. Plus, by manually specifying the release title, we make sure to avoid any conflicts, eliminating the need for the run ID. * `pb.yml`: Only trigger release step on `workflow-dispatch` This mimics `sct_tutorial_data` et al. * `pb.yml`: Set `draft: true` and remove `prerelease:` Since we're no longer creating all these intermediate releases, and only creating a release when manually choosing to, I think it makes more sense to just create a draft release (rather than a non-draft prerelease). This also matches what we do for `sct_tutorial_data`. --------- Co-authored-by: Joshua Newton <[email protected]>
- Loading branch information