-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (49 loc) · 1.24 KB
/
publish.yaml
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
name: publish
on:
push:
branches: [main]
# only read-only for GITHUB_TOKEN
permissions:
contents: read
jobs:
publish_audit:
name: audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
publish_test:
name: test on ${{ matrix.os }} / stable
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo test --locked
run: cargo test --locked --all-features
publish:
name: publish to crates.io
needs:
- publish_audit
- publish_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-release
run: cargo install cargo-release
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Publish
run: |-
cargo release \
publish \
--all-features \
--allow-branch main \
--no-confirm \
--execute