Skip to content

Create the GitHub release when publishing, as the other languages do - #204

Merged
jwrosewell merged 1 commit into
mainfrom
fix/publish-creates-release
Oct 27, 2026
Merged

jwrosewell merged 1 commit into
mainfrom
fix/publish-creates-release

Conversation

@jwrosewell

Copy link
Copy Markdown
Contributor

Problem

The publish workflow (.github/workflows/publish.yml) publishes the crates and writes the version tag, but it stops at the tag. No GitHub release is created, so the release pages for 4.5.9, 4.5.10, 4.5.11 and 4.5.12 were all created by hand after each publish.

The other languages get their release from the publish. common-ci's steps/update-tag.ps1 pushes the tag and then runs gh release create --verify-tag --generate-notes. When this workflow's tag step was written it copied the tagging half and left out the release.

Change

The "Tag what was published" step becomes "Tag and release what was published".

  • It pushes the tag as before, unless the tag is already there.
  • It then runs gh release create <version> --verify-tag --generate-notes --title <version>, unless that release is already there, so a rerun after a failure part way through finishes the job without failing on what already exists.
  • GH_TOKEN is the run's own token. The job already has contents: write, which creating a release needs, and the comment on that permission now says so.

gh release view exits non-zero when the release is missing, so the step turns off $PSNativeCommandUseErrorActionPreference around that one call and treats the exit code as the answer.

How it was verified

  • The workflow parses as YAML, and the step carries VERSION and GH_TOKEN in its environment.
  • The step's script was run locally in pwsh with $ErrorActionPreference = 'stop' and GitHub's closing exit $LASTEXITCODE, with git tag, git push and gh release create replaced by stubs and gh release view left real against this repository.
    • For 4.5.12, whose release exists, it reported the release already there and exited 0.
    • For 9.9.9, which has no release, it reached gh release create 9.9.9 --verify-tag --generate-notes --title 9.9.9 and exited 0.
  • The real proof is the next publish, which should create its own release page.

What remains

Nothing in this repository. Release notes are generated from the merged pull request titles, so they read as well as those titles do.

…ges do

The publish workflow wrote the version tag but stopped there, so every
release page from 4.5.9 to 4.5.12 was created by hand. common-ci's
steps/update-tag.ps1 tags and then runs gh release create with generated
notes for the other languages. This step now does the same, and skips
either half when it already exists, so a rerun finishes what a failed run
left undone.
@jwrosewell
jwrosewell marked this pull request as ready for review October 27, 2026 16:03
@jwrosewell
jwrosewell merged commit bd8428c into main Oct 27, 2026
19 checks passed
@jwrosewell
jwrosewell deleted the fix/publish-creates-release branch October 27, 2026 16:03
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

Successfully merging this pull request may close these issues.

1 participant