Skip to content

Commit b8667c9

Browse files
committed
ci: add automatic deb package building on release
1 parent 23814fd commit b8667c9

File tree

10 files changed

+316
-213
lines changed

10 files changed

+316
-213
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,26 @@ jobs:
1212
name: Check
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions-rs/toolchain@v1
17-
with:
18-
profile: minimal
19-
toolchain: stable
20-
override: true
21-
- uses: actions-rs/cargo@v1
22-
with:
23-
command: check
15+
- uses: actions/checkout@v3
16+
- uses: dtolnay/rust-toolchain@stable
17+
- run: cargo check
2418

2519
fmt:
2620
name: Rustfmt
2721
runs-on: ubuntu-latest
2822
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions-rs/toolchain@v1
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@stable
3125
with:
32-
profile: minimal
33-
toolchain: stable
34-
override: true
35-
- run: rustup component add rustfmt
36-
- uses: actions-rs/cargo@v1
37-
with:
38-
command: fmt
39-
args: --all -- --check
26+
components: rustfmt
27+
- run: cargo fmt --all -- --check
4028

4129
clippy:
4230
name: Clippy
4331
runs-on: ubuntu-latest
4432
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions-rs/toolchain@v1
47-
with:
48-
profile: minimal
49-
toolchain: stable
50-
override: true
51-
- run: rustup component add clippy
52-
- uses: actions-rs/cargo@v1
33+
- uses: actions/checkout@v3
34+
- uses: dtolnay/rust-toolchain@stable
5335
with:
54-
command: clippy
55-
args: -- -D warnings
36+
components: clippy
37+
- run: cargo clippy -- -D warnings

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
env:
8+
RUST_BACKTRACE: 1
9+
10+
jobs:
11+
release:
12+
name: Semantic Release
13+
runs-on: ubuntu-latest
14+
if: github.actor != 'sbosnick-bot'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
22+
23+
- name: Install Rust Stable
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Semantic Release
27+
uses: cycjimmy/semantic-release-action@v3
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
id: semantic
31+
with:
32+
semantic_version: 19.0.5
33+
extra_plugins: |
34+
@semantic-release/[email protected]
35+
@semantic-release/[email protected]
36+
@semantic-release/[email protected]

.releaserc.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
branches:
2+
- main
3+
4+
plugins:
5+
- '@semantic-release/commit-analyzer'
6+
- '@semantic-release/release-notes-generator'
7+
- '@semantic-release/changelog'
8+
- - '@semantic-release/exec'
9+
- prepareCmd: "./semantic-release-build.sh ${nextRelease.version}"
10+
- - '@semantic-release/github'
11+
- assets:
12+
- target/arm-unknown-linux-gnueabihf/debian/*.deb
13+
- - '@semantic-release/git'
14+
- assets:
15+
- CHANGELOG.md
16+
- Cargo.toml
17+
- Cargo.lock
18+
message: "chore(release): set `Cargo.toml` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

0 commit comments

Comments
 (0)