name: Linux Packages (APT/RPM)
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to package'
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
debian-package:
name: Build Debian Package (.deb)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Rust with caching
uses: ./.github/actions/setup-rust-cached
with:
toolchain: stable
cache-key: deb
- name: Install cargo-deb
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-deb@2.7.0
- name: Build release binary
run: cargo build --release
- name: Create debian package
run: cargo deb --no-build --output target/debian/nsip.deb
- name: Upload debian package
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f with:
name: debian-package
path: target/debian/*.deb
retention-days: 90
- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b with:
files: target/debian/*.deb
rpm-package:
name: Build RPM Package (.rpm)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup Rust with caching
uses: ./.github/actions/setup-rust-cached
with:
toolchain: stable
cache-key: rpm
- name: Install cargo-generate-rpm
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-generate-rpm@0.15.1
- name: Build release binary
run: cargo build --release
- name: Strip binary
run: strip target/release/nsip
- name: Create RPM package
run: cargo generate-rpm
- name: Upload RPM package
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f with:
name: rpm-package
path: target/generate-rpm/*.rpm
retention-days: 90
- name: Upload to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b with:
files: target/generate-rpm/*.rpm