From da320d2da2bd976c304eb93fc68755c0ed436b17 Mon Sep 17 00:00:00 2001 From: Sid Jain Date: Sun, 26 Apr 2026 15:13:30 +0530 Subject: [PATCH] fix: make manual release fail on no-op publish --- .github/workflows/release.yml | 8 ++++++++ docs/RELEASE.md | 6 ++++++ release-plz.toml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca4560d3..43da1336 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -120,9 +120,17 @@ jobs: run: cargo package --locked --list - name: Run release-plz + id: release_plz uses: release-plz/action@v0.5 with: command: release dry_run: ${{ inputs.operation == 'publish-dry-run' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Require release output + if: ${{ steps.release_plz.outputs.releases_created != 'true' }} + run: | + echo "release-plz completed without creating a release." >&2 + echo "Check that Cargo.toml contains an unpublished version and that release-plz is allowed to release the current main commit." >&2 + exit 1 diff --git a/docs/RELEASE.md b/docs/RELEASE.md index b125ca00..147b567b 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -46,6 +46,12 @@ intent check treats these paths as release-affecting: `Cargo.toml`, `Cargo.lock` 4. Run `Release` from `main` with `publish-dry-run`. 5. If the dry run passes, run `Release` again with `publish`. +The manual publish job uses `release_always = true` because the workflow is not +triggered on every merge; it only runs when a maintainer explicitly selects a +publish operation. The job fails if release-plz reports that it created no +release, so a green publish run means a crate/GitHub release was actually +produced. + release-plz publishes unpublished package versions to crates.io, creates the bare SemVer tag such as `0.2.0`, and creates the GitHub release from the generated changelog. Bare SemVer tags intentionally match the existing `0.1.0` tag. diff --git a/release-plz.toml b/release-plz.toml index e201a866..5a9e87f3 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -10,7 +10,7 @@ pr_labels = ["release"] pr_name = "chore(release): {{ version }}" publish = true publish_timeout = "30m" -release_always = false +release_always = true release_commits = '^((feat|fix|perf|refactor|revert)(\([a-z0-9][a-z0-9._/-]*\))?(!)?|[a-z]+(\([a-z0-9][a-z0-9._/-]*\))?!): .+' repo_url = "https://github.com/f0rr0/pglite-oxide" semver_check = true