taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
227 stars 19 forks source link

Support for use on non-tags #34

Closed leighmcculloch closed 1 year ago

leighmcculloch commented 1 year ago

Something I've noticed is that the current action can only be executed from a tag, due to these lines:

https://github.com/taiki-e/upload-rust-binary-action/blob/0b10335ed20430900b5597e792b8f95be95e8aa2/main.sh#L24-L27

There are cases that a binary release might be run from a branch rather than from a tag. An example of this is when retroactively running a CI job for an already released tag.

taiki-e commented 1 year ago

Since GitHub releases are associated with tags, to know which release to upload binaries to, we need information about the tag.

It refers to GITHUB_REF by default, but you can specify this using the ref input option. Therefore, you can upload binaries from any event by specifying the ref input option.

taiki-e commented 1 year ago

Documented as https://github.com/taiki-e/upload-rust-binary-action#supported-events.

leighmcculloch commented 1 year ago

Thanks, that's very helpful. Thank you!