-
Notifications
You must be signed in to change notification settings - Fork 77
73 lines (63 loc) · 2.01 KB
/
release.yml
File metadata and controls
73 lines (63 loc) · 2.01 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Release
on:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
jobs:
# It's arguable we don't need this job in the release workflow because we've already checked if
# the code can build in the merge workflow, but there's litte harm running it here as an extra
# safety measure, even though we're not doing anything with the built artifacts.
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo build
run: cargo build --release --workspace
publish:
name: Publish
runs-on: ubuntu-latest
needs: build
steps:
# `release-plz` cannot create tags unless the checkout uses the token
- uses: actions/checkout@v4
with:
fetch-depth: "0"
token: ${{ secrets.SELF_ENCRYPTION_PAT }}
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# This is required to allow `release-plz` to create tags
- shell: bash
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- uses: cargo-bins/cargo-binstall@main
- shell: bash
run: cargo binstall --no-confirm release-plz
- name: publish crates
shell: bash
run: |
cargo login "${{ secrets.CRATES_IO_TOKEN }}"
release-plz release --git-token ${{ secrets.SELF_ENCRYPTION_PAT }}