-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (60 loc) · 1.65 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pre-requirements
run: sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -q -y
- name: Install cargo-generate-rpm
run: cargo install cargo-generate-rpm
- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build
run: cargo build --release
- name: Generate RPM
run: cargo generate-rpm
- name: Generate DEB
run: cargo deb
- name: Save RPM / DEB name
run: |
echo "rpm_name=$(ls target/generate-rpm/)" >> "$GITHUB_ENV"
echo "deb_name=$(ls target/debian/ -I *-stripped)" >> "$GITHUB_ENV"
- name: Upload RPM
uses: actions/upload-artifact@v4
with:
path: target/generate-rpm/
name: ${{ env.rpm_name }}
- name: Upload Deb
uses: actions/upload-artifact@v4
with:
path: target/debian/${{ env.deb_name }}
name: ${{ env.deb_name }}
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: ./
merge-multiple: true
- name: List Files
run: |
pwd
ls -lah ./
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: |
*.rpm
*.deb