-
-
Notifications
You must be signed in to change notification settings - Fork 43
52 lines (48 loc) · 1.24 KB
/
rs-ci.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
name: Rust
on:
push:
branches:
- main
tags:
- "*"
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
checks:
name: Rust checks
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v4
- name: Run format
run: cargo make format
- name: Run check
run: cargo make check
- name: Run check doc
run: cargo make check-doc
- name: Run clippy
run: cargo make clippy
- name: Run test
run: cargo make test
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
needs: [checks]
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo login
run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Run build
run: cargo build --package tapo --release --verbose
- name: Run cargo publish
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: cargo publish --package tapo