Refactor GitHub workflows - #561
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors GitHub Actions workflows to standardize naming, tighten release triggers, and add manual release re-run support via workflow_dispatch inputs.
Changes:
- Renames/introduces workflows to follow a consistent
<category>-<target>.ymlconvention and updates the README test badge accordingly. - Updates release workflows to support
workflow_dispatchwith ataginput and adds tag-fallback logic for version bumping/packaging. - Modernizes benchmark workflows by bumping
actions/checkoutto@v4andcodecov/codecov-actionto@v4.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Updates the CI badge to point at the renamed Python unit test workflow. |
.github/workflows/unittests-python.yml |
Adds a dedicated Python unit test workflow that reuses the shared poetry test workflow. |
.github/workflows/release-python.yml |
Replaces the old PyPI workflow with a renamed release workflow and adds manual dispatch support. |
.github/workflows/release-pyapi.yml |
Adds semver-ish tag filtering plus manual dispatch/tag fallback for maturin wheel publishing. |
.github/workflows/release-ekors.yml |
Adds semver-ish tag filtering plus manual dispatch/tag fallback for maturin wheel publishing. |
.github/workflows/release-crates.yml |
Adds semver-ish tag filtering plus manual dispatch/tag fallback for crates publishing. |
.github/workflows/release-capi.yml |
Adds semver-ish tag filtering plus manual dispatch/tag fallback and updates macOS runner selection. |
.github/workflows/pypi.yml |
Removes the old PyPI release workflow (superseded by release-python.yml). |
.github/workflows/bench-lha.yml |
Updates checkout action version. |
.github/workflows/bench-lha-rust.yml |
Updates checkout action version. |
.github/workflows/bench-iso.yml |
Updates checkout and codecov action versions. |
Suppressed comments (7)
.github/workflows/release-capi.yml:22
- On
workflow_dispatchruns with ataginput,actions/checkoutwill still check out the branch selected in the UI (not the tag being republished). That can build/upload artifacts from the wrong commit into the existing release tag. Consider checking out the provided tag ref (and fetching tags) in this and the other checkout steps in this workflow (e.g. build job at line 59).
- uses: actions/checkout@v4
.github/workflows/release-crates.yml:6
- GitHub Actions tag filters use glob patterns (not regex). The current pattern
v[0-9]+*requires a literal+, so typical semver tags likev1.2.3will not trigger this workflow.
This issue also appears on line 21 of the same file.
.github/workflows/release-crates.yml:23
- For manual re-publish runs (
workflow_dispatch+tag), this workflow currently checks out the UI-selected branch instead of the tag commit being republished, which can publish crates from the wrong source. Also,actions/setup-pythonis used without pinning a version, which makes releases less reproducible.
.github/workflows/release-ekors.yml:6 - GitHub Actions tag filters use glob patterns (not regex). The current pattern
v[0-9]+*requires a literal+, so typical semver tags likev1.2.3will not trigger this workflow.
This issue also appears on line 22 of the same file.
.github/workflows/release-ekors.yml:22
- On
workflow_dispatchruns with ataginput,actions/checkoutwill check out the branch selected in the UI rather than the tag commit. That can produce/publish artifacts from the wrong revision. Consider checking out the provided tag ref in this job and in the other checkout steps later in this file (e.g. lines 55, 95, ...).
.github/workflows/release-python.yml:24 workflow_dispatchre-publish runs with atagwill call the reusablepython-poetry-pypi-with-data.yml, but that reusable workflow always checks out the UI-selected ref (not the tag commit) and always publishes to PyPI. That means a manual re-publish can publish from the wrong revision, and there is currently no way to do a tagless "dry build" despite the PR description.
publish:
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != ''
uses: ./.github/workflows/python-poetry-pypi-with-data.yml
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
poetry-extras: "-E mark -E box"
data-version: "v2"
data-download: "./tests/data/assets.sh"
.github/workflows/release-pyapi.yml:27
- With the new
workflow_dispatch+tagsupport, this workflow can be run from a branch while trying to (re)publish an existing tag. Howeveractions/checkout@v4(line 22) will still check out the UI-selected ref, so the bump/build steps can run against the wrong commit for the requested tag. Consider checking out the provided tag ref (and doing the same for the other checkout steps later in this file).
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != ''
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Perhaps this is a good time to change to trusted publishing for eko (instead of creating a new token for the new package). For now I added the trusted publisher pointing to I've also pre-created the |
felixhekhorn
left a comment
There was a problem hiding this comment.
thanks for doing a more extensive review of the workflow files
|
Also, remember to update Line 370 in f131c1b |
There's an issue in this.
Please update the permissions respectively. |
|
Ah, my bad,
Now |
Fixes #560.
In this PR we:
<category>-<target>.ymlconvention (unittests-*,release-*,bench-*):unittests.ymlunittests-python.ymlpypi.ymlrelease-python.ymlcrates.ymlrelease-crates.ymlmaturin.ymlrelease-ekors.ymlisobench.ymlbench-iso.ymllha_bot.ymlbench-lha.ymllha_bot_rust.ymlbench-lha-rust.yml'v[0-9]+*').workflow_dispatchwith ataginput across all release workflows to allow completing or retrying partially failed releases.TAG: ${{ github.event.inputs.tag || github.ref_name }}) for version bumping and artifact packaging.if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != '') so manual runs with a tag can publish, while tagless runs perform dry builds.actions/setup-python@v5across release version-bumping steps.@v2actions to@v4(actions/checkout@v4andcodecov/codecov-action@v4) in benchmark workflows.README.mdtounittests-python.yml.