-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (68 loc) · 2.14 KB
/
release.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
name: "Publish"
on:
release:
types: [published]
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo check
run: cargo check
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86-unknown-linux-gnu
- thumbv6m-none-eabi
- thumbv7m-none-eabi
- thumbv7em-none-eabi
- thumbv7em-none-eabihf
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: cargo test
- name: Run cargo test with all features
run: cargo test --all-features
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo clippy
run: cargo clippy -- -D warnings
publish:
name: crates.io release
if: startsWith(github.ref, 'refs/tags/v')
needs: [check, test, lints]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: get_version
uses: battila7/get-version-action@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-workspaces
run: cargo install cargo-workspaces
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
VERSION: ${{ steps.get_version.outputs.version-without-v }}
shell: bash
run: |
git config --global user.email "runner@gha.local"
git config --global user.name "Github Action"
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom $VERSION