-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (59 loc) · 1.75 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (59 loc) · 1.75 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
53
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
package:
name: Package ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: release-${{ matrix.target }}
- name: Install RPM tools
run: sudo apt-get update && sudo apt-get install -y rpm
- name: Install packagers
run: cargo install cargo-deb cargo-generate-rpm --locked
- name: Build release binary
run: cargo build --release --all-features --target ${{ matrix.target }}
- name: Build DEB
run: cargo deb --no-build --target ${{ matrix.target }}
- name: Build RPM
run: cargo generate-rpm --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.target }}
path: |
target/${{ matrix.target }}/debian/*.deb
target/${{ matrix.target }}/generate-rpm/*.rpm
if-no-files-found: error
release:
name: Publish GitHub Release
needs: package
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: packages-*
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: |
dist/**/*.deb
dist/**/*.rpm
generate_release_notes: true