Skip to content

Commit 0c32f2e

Browse files
authored
more release automation (#2796)
* automatically publish after cli release is created * a more accurate term * explain --no-publish
1 parent 6e42ccf commit 0c32f2e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# To trigger this:
2-
# - go to Actions > Publish
3-
# - click the Run Workflow dropdown in the top-right
4-
name: Publish
5-
on: workflow_dispatch
1+
# This is triggered after the Release workflow successfully completes its run
2+
on:
3+
workflow_run:
4+
workflows:
5+
- Release
6+
types:
7+
- completed
68
env:
79
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
810
jobs:
911
cargo-publish:
1012
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1114
steps:
1215
- name: Checkout sources
1316
uses: actions/checkout@v3

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ cargo release [patch|minor] --no-publish --execute
563563
This does the following:
564564

565565
- Bump the version.
566-
- Turn the `Unreleased` section of the changelog into the section for the version being published.
566+
- Turn the `Unreleased` section of the changelog into the section for the version being released.
567567
- Update the table of contents of the changelog using `doctoc`.
568568
- Tag (`git tag`) the HEAD commit
569569
- Push (`git push`) to GitHub
@@ -573,6 +573,10 @@ The `patch` and `minor` refer to semver concepts:
573573
- `patch` would bump __v0.68.1__ to __v0.68.2__
574574
- `minor` would bump __v0.68.2__ to __v0.69.0__
575575

576+
> NOTE:
577+
> We use the `--no-publish` so that the crates are only published after the release is complete.
578+
> This is automatic, provided the release CI job is successful.
579+
576580
### Create a new release on Github
577581

578582
The release is automated with the help of `.github/workflows/release.yml`,

0 commit comments

Comments
 (0)