-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (49 loc) · 1.47 KB
/
release.yml
File metadata and controls
52 lines (49 loc) · 1.47 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
name: Release
on:
pull_request:
merge_group:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7m-none-eabi
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: python scripts/sync_code.py --check
- run: cargo build --release --features=stm32f100,xC
- run: python scripts/build.py build --release
- run: python scripts/build.py clippy
- run: python scripts/build.py test
- run: python scripts/build.py build --example=f103c8
publish:
needs: test
runs-on: ubuntu-latest
environment: release # Optional: for enhanced security
permissions:
id-token: write # Required for OIDC token exchange
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7m-none-eabi
- name: Dry run
if: github.ref_type != 'tag'
run: cargo publish --features=stm32f103,xG --dry-run
- uses: rust-lang/crates-io-auth-action@v1
if: github.ref_type == 'tag'
id: auth
- name: Publish crate
if: github.ref_type == 'tag'
run: cargo publish --features=stm32f103,xG
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}