-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (75 loc) · 1.94 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
74
75
name: Lint and build
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install libcurl4-openssl-dev, libpam0g-dev, dpkg-dev
run: sudo apt install libcurl4-openssl-dev libpam0g-dev dpkg-dev
- name: Checkout
uses: actions/checkout@v2
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-2-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-2-
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
override: true
- name: Install cargo-deb
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deb
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D clippy::all
- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run cargo deb
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build
- name: Copy build artifact
run: cp target/release/libpam_bacchus.so pam_bacchus.so
- name: Upload build artifact (lib)
uses: actions/upload-artifact@v2
with:
name: lib
path: pam_bacchus.so
- name: Upload build artifact (deb)
uses: actions/upload-artifact@v2
with:
name: deb
path: target/debian/*.deb
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
pam_bacchus.so
target/debian/*.deb