1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Release Please
on:
push:
branches:
permissions:
contents: write
pull-requests: write
jobs:
# Maintains a "release PR" that accrues changelog entries and the next
# version from Conventional Commits. Merging that PR creates the git tag and
# a *draft* GitHub Release (see draft/force-tag-creation in
# release-please-config.json).
#
# This uses a PAT rather than the default GITHUB_TOKEN on purpose: a tag
# pushed by GITHUB_TOKEN does NOT trigger other workflows, so the tag-driven
# `release.yml` (dist) would never run. The PAT must have contents:write on
# this repo. dist then builds the binaries, uploads them to the draft
# release, and undrafts it (create-release = false in dist-workspace.toml).
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
# Publish the crate to crates.io when a release is cut. Independent of the
# prebuilt binaries — those are built and attached to the GitHub Release by
# dist in `release.yml`, triggered by the tag above.
publish-crate:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}