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

Provide a way to create releases for pre-existing tags #1094

Open
Shnatsel opened this issue May 24, 2024 · 4 comments
Open

Provide a way to create releases for pre-existing tags #1094

Shnatsel opened this issue May 24, 2024 · 4 comments

Comments

@Shnatsel
Copy link

I am adding cargo dist to my project, cargo auditable. I would like to build binaries for the latest release, which was cut before I added cargo dist.

As per the documentation, 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, 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.

@ashleygwilliams
Copy link
Member

ashleygwilliams commented May 24, 2024

hey! those docs were written before we had the dispatch_releases option, which takes a tag as an input. combined with our create_release option (which when set to false expects a release already exists).... i think this is actually achievable now! i will run a few tests.

@Shnatsel
Copy link
Author

Thank you!

I admit I am confused by the documentation of dispatch-releases option.

Specifically, I do not understand how do I trigger it. Is it the usual "Actions > Release > Run workflow", or do I manually create a Github release, or both?

It also says...

Currently hosting is also disabled, but future versions may add some forms of hosting in this mode.

But I don't understand if that applies only to the dry-run tag or all workflows, and what "hosting" even means here - is it uploading binaries to Github releases, or somewhere else? Or is it something else entirely?

@ashleygwilliams
Copy link
Member

Is it the usual "Actions > Release > Run workflow"

yes, it's this, and there's a prompt for you to enter the tag

re: hosting i believe that means that we can't host on our own infra using this pathway

here's an example of a user of this feature: https://github.com/astral-sh/uv/actions/workflows/release.yml
(honestly i really think this is the way to go, as a lot of downstreams appreciate when tags are treated as immutable, and this workflow really enables that but making the tag a part of the final announce step instead of the initiator!)

@ashleygwilliams
Copy link
Member

(appreciate you pointing out the docs being confusing though- i agree with you, and we should definitely improve them!!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants