Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,27 @@ jobs:
- name: Inspect package contents
run: cargo package --locked --list

- name: Run release-plz
id: release_plz
- name: Run release-plz dry run
if: ${{ inputs.operation == 'publish-dry-run' }}
uses: release-plz/action@v0.5
with:
command: release
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run release-plz publish
if: ${{ inputs.operation == 'publish' }}
id: release_plz_publish
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' }}
if: ${{ inputs.operation == 'publish' && steps.release_plz_publish.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
echo "Check that Cargo.toml contains an unpublished version and that release-plz was run without dry_run." >&2
exit 1
3 changes: 2 additions & 1 deletion docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ 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.
produced. The dry-run and publish action steps are intentionally separate so the
real publish step omits the `dry_run` input entirely.

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
Expand Down