axodotdev / axodotdev/cargo-dist
Provide a way to create releases for pre-existing tags
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 149
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 32
Description
I am [adding](https://github.com/rust-secure-code/cargo-auditable/pull/152) `cargo dist` to my project, [`cargo auditable`](https://github.com/rust-secure-code/cargo-auditable). I would like to build binaries for the latest release, which was cut before I added `cargo dist`.
As per the [documentation,](https://axodotdev.github.io/cargo-dist/book/workspaces/simple-guide.html) this is not possible today:
> TO BE EXTREMELY PEDANTIC: The workflow will trigger whenever Github sees that the git tag and the commit it refers to are part of the repo and the timestamp(?) of both(?) is after the commit that introduced the workflow's yml file. That last part is an absolute headache, and may require you to delete the tag both locally and on github if you created it before the workflow. Basically, setup cargo-dist before you start cutting releases!
I have experimented with this [in a fork](https://github.com/Shnatsel/cargo-auditable-actions-test), and indeed deleting and recreating the tag does not trigger the release workflow.
## Potential solution
At least on Github actions, it is possible to let the user manually invoke a workflow for a given tag. But the workflow has to explicitly support this: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
Allowing the workflows to be manually invoked for a specific tag would allow creating binary artifacts for pre-existing tags.
The potentially tricky bit is "what if a release already exists?", but that case needs to be handled by the workflows anyway because building binaries can fail due to a transient network error after a release has been created, and it needs to be able to recover from that regardless.
Contributor guide
Research direction
Read the release workflow's yml file and the GitHub Actions documentation for manually running workflows first. Trace how a tag currently triggers the workflow, then define behavior for manually selecting a pre-existing tag and for an already-created release; done means the workflow can produce artifacts for that tag and recover from transient failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, rust
- Domain
- ci-cd, release
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100