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
name: Release-plz
on:
push:
branches:
- main
# If multiple pushes to main happen quickly, queue them instead of running
# in parallel. cancel-in-progress is false so we never skip a release.
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
jobs:
# Publishes to crates.io when Cargo.toml has a version newer than what's
# on crates.io (i.e., after a release PR is merged).
# Git tags and GitHub Releases are disabled in release-plz.toml.
release-plz-release:
name: Release
runs-on: ubuntu-latest
environment: protected-main-env
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Full history is needed so release-plz can find the last release
# tag and generate accurate changelogs.
fetch-depth: 0
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- uses: release-plz/action@1528104d2ca23787631a1c1f022abb64b34c1e11 # v0.5.128
with:
# "release" compares Cargo.toml version to crates.io; if newer,
# publishes to crates.io via `cargo publish`.
command: release
env:
# GITHUB_TOKEN: required by release-plz for GitHub API access.
# CARGO_REGISTRY_TOKEN: used to authenticate `cargo publish`.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}