Fix the release workflow so a dispatch actually produces assets - #47
Fix the release workflow so a dispatch actually produces assets#47philipbjorge wants to merge 3 commits into
Conversation
The build matrix runs with the default fail-fast, so the first leg that fails cancels every other leg. In the v0.3.26 release run, the Windows and x86_64 Linux legs failed before executing a single step, the three remaining legs were cancelled, `upload` was skipped through `needs`, and the release published with no assets at all. Set fail-fast: false so an unavailable runner costs one target instead of all five, and let `upload` run whenever the matrix is not cancelled so a partial asset set still reaches the release. Guard the upload with an explicit check that at least one artifact arrived, so a fully failed matrix fails loudly here rather than silently publishing nothing.
The workflow takes no input, so every job builds whatever ref the dispatch happened to use and `softprops/action-gh-release` falls back to github.ref for the target release. Dispatching from a branch therefore builds the branch and attaches assets to a ref that is not a release tag, and the crates.io publish step packages the branch rather than the tagged source. Add a required `tag` input, check it out in both the build matrix and the publish job, and pass it to the release action explicitly.
The Windows and Linux legs request Blacksmith runners. In the v0.3.26 run neither could be acquired and both jobs failed without executing a step, which is what took the release down. PR Check uses the same Linux label successfully, so the label is live; the release matrix asks for three Blacksmith runners at once and does not get them. Move the five release targets to GitHub-hosted runners. This repository is public, so those minutes are free, and a dispatch-only release that runs a few times a month then draws nothing from the shared Blacksmith pool. That serves ADR 0001's goal — protect the shared pool — more completely than routing release builds through it. PR Check stays on Blacksmith, unchanged.
|
The red PR Check here is the pre-existing #46 includes the one-line fix, so this goes green once that lands (or if you would rather have it here instead, say the word and I will move it). |
|
@Finesssee Please can we get this merged? CI is broken! Please consider adding collaborators to the project. I am tempted to fork it but I don't want to set up a competing crate. |
|
I'm setting up circleCI to make it work rn and I would love some help a temp collaborator on this project |
|
That's great. Assuming you are talking about moving from Blacksmith, could you remind us newcomers why you can't use Github CI? Feel free to add me as a maintainer. If you want I can restrict my attention to CI, or whatever. For reference, I'm here because the macOS images are absent. |
Addresses #43. Every Release run since v0.3.7 has failed, which is why v0.3.26 shipped with no assets and v0.3.27 is Windows-only. There are three independent causes; each is its own commit so you can take them separately.
1. One failed leg cancels the rest
The v0.3.26 run:
Zero steps on the failed jobs means they never acquired a runner. Default
fail-fastthen cancelled the three healthy legs, andneeds: buildskipped the upload — so a runner-availability problem on two targets became a release with nothing attached.fail-fast: falsemakes an unavailable runner cost one target instead of five.uploadnow runs on!cancelled()so a partial asset set still reaches the release, with an explicit guard that fails loudly if nothing built rather than silently publishing an empty release.2. The dispatched tag is never actually used
workflow_dispatchtakes no inputs, so:softprops/action-gh-releasefalls back togithub.reffor the target release, which is a branch ref whenever the workflow is dispatched from a branch rather than a tag;publishjob checks out that same ref, socargo publishcan package the branch instead of the tagged source.This adds a required
taginput, checks it out in both the build matrix and the publish job, and passes it to the release action explicitly.3. The release matrix cannot get Blacksmith runners
The Windows and Linux legs request Blacksmith runners and failed without executing a step. The label is live — PR Check uses
blacksmith-4vcpu-ubuntu-2404successfully — but the release matrix requests three Blacksmith runners simultaneously and does not get them.This moves the five release targets to GitHub-hosted runners. I want to be careful here because ADR 0001 is explicit about protecting the shared Blacksmith pool: this repository is public, so GitHub-hosted minutes are free, and a dispatch-only release that runs a few times a month then draws nothing from the shared pool. That serves the ADR's stated goal more completely than routing release builds through it. PR Check stays on Blacksmith, untouched.
If you would rather keep the release on Blacksmith, commits 1 and 2 stand on their own and are worth taking regardless — commit 1 alone would have given v0.3.26 its macOS assets.
Verification
actionlintpasses clean on the result. I have not been able to execute the workflow against your runners, so the runner change in commit 3 is the one piece verified by reasoning rather than by a run.