CI: Add Debian package generation

This commit is contained in:
Jack Grigg
2021-04-11 20:17:14 +12:00
parent d4c53157a7
commit f46b3f973f
2 changed files with 72 additions and 0 deletions
+61
View File
@@ -84,3 +84,64 @@ jobs:
tag: ${{ github.ref }} tag: ${{ github.ref }}
prerelease: true prerelease: true
if: github.event.inputs.test != 'true' if: github.event.inputs.test != 'true'
deb:
name: Debian ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
name: [linux]
include:
- name: linux
target: x86_64-unknown-linux-gnu
build_deps: >
libpcsclite-dev
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: cargo install cargo-deb
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deb
- name: Install build dependencies
run: sudo apt install ${{ matrix.build_deps }}
if: matrix.build_deps != ''
- name: Set up .cargo/config
run: |
mkdir .cargo
echo '${{ matrix.cargo_config }}' >.cargo/config
if: matrix.cargo_config != ''
- name: cargo build
run: cargo build --release --locked --target ${{ matrix.target }} ${{ matrix.build_flags }}
- name: Generate manpages
uses: actions-rs/cargo@v1
with:
command: run
args: --example generate-docs
- name: cargo deb
uses: actions-rs/cargo@v1
with:
command: deb
args: --package age-plugin-yubikey --no-build --target ${{ matrix.target }}
- name: Upload Debian package to release
uses: svenstaro/upload-release-action@2.2.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/debian/*.deb
tag: ${{ github.ref }}
file_glob: true
prerelease: true
if: github.event.inputs.test != 'true'
+11
View File
@@ -10,6 +10,17 @@ categories = ["command-line-utilities", "cryptography"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2018"
[package.metadata.deb]
extended-description = """\
An age plugin adding support for YubiKeys and other PIV hardware tokens. \
Currently in BETA; we strongly recommend using this with a new YubiKey."""
section = "utils"
assets = [
["target/release/age-plugin-yubikey", "usr/bin/", "755"],
["target/manpages/age-plugin-yubikey.1.gz", "usr/share/man/man1/", "644"],
["README.md", "usr/share/doc/age-plugin-yubikey/README.md", "644"],
]
[dependencies] [dependencies]
age-core = "0.5" age-core = "0.5"
age-plugin = "0.0" age-plugin = "0.0"