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
name: Release
on:
push:
branches:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'chore:')"
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.INFRA_DEPLOY_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install knope
run: |
curl -sSL "https://github.com/knope-dev/knope/releases/latest/download/knope-x86_64-unknown-linux-musl.tgz" | tar xz --strip-components=1
mv knope /usr/local/bin/
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Authenticate with crates.io
id: crates-auth
uses: rust-lang/crates-io-auth-action@v1
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.INFRA_DEPLOY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ steps.crates-auth.outputs.token }}
run: knope release || echo "No unreleased changes"