v2.0.1 #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |