feat: version 0.4.2 #53
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: CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- src/* | |
- icons/* | |
- package/* | |
- .github/workflows/*.yml | |
- Cargo.toml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- src/* | |
- icons/* | |
- package/* | |
- .github/workflows/*.yml | |
- Cargo.toml | |
release: | |
types: [published] | |
jobs: | |
commits: | |
name: commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: webiny/[email protected] | |
linter: | |
name: linter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y libgtk-4-dev libglib2.0-dev | |
- name: Clippy | |
run: cargo clippy --all --all-features -- -D warnings | |
- name: Format | |
run: cargo fmt --all -- --check | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, ubuntu-latest-arm64] | |
include: | |
- os: ubuntu-latest | |
arch: amd64 | |
- os: ubuntu-latest-arm64 | |
arch: arm64 | |
name: build ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
needs: linter | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: > | |
sudo apt update && sudo apt install -y | |
libgtk-4-dev | |
libglib2.0-dev | |
build-essential | |
ruby | |
ruby-dev | |
rubygems | |
libarchive-tools | |
- name: Install fpm | |
run: sudo gem install fpm | |
- name: Build project | |
run: cargo build --release | |
- name: Build debian package | |
run: > | |
fpm -t deb -p airgorah_${{ matrix.arch }}.deb --architecture native | |
--depends policykit-1 | |
--depends "libgtk-4-1 (>= 4.6.0)" | |
--depends dbus-x11 | |
--depends wireshark-common | |
--depends iproute2 | |
--depends mdk4 | |
--depends crunch | |
- name: Save debian artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: airgorah_${{ matrix.arch }}.deb | |
path: ./airgorah_${{ matrix.arch }}.deb | |
if-no-files-found: error | |
- name: Build redhat package | |
run: > | |
fpm -t rpm -p airgorah_${{ matrix.arch }}.rpm --architecture native | |
--depends polkit | |
--depends "gtk4-devel >= 4.6.0" | |
--depends dbus-x11 | |
--depends wireshark-cli | |
--depends iproute | |
- name: Save redhat artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: airgorah_${{ matrix.arch }}.rpm | |
path: ./airgorah_${{ matrix.arch }}.rpm | |
if-no-files-found: error | |
- name: Build archlinux package | |
run: > | |
fpm -t pacman -p airgorah_${{ matrix.arch }}.pkg.tar.zst --architecture native | |
--depends polkit | |
--depends "gtk4 (>= 4.6.0)" | |
--depends dbus | |
--depends wireshark-cli | |
--depends iproute2 | |
--depends mdk4 | |
- name: Save archlinux artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: airgorah_${{ matrix.arch }}.pkg.tar.zst | |
path: ./airgorah_${{ matrix.arch }}.pkg.tar.zst | |
if-no-files-found: error | |
- name: Name packages for release | |
if: github.event_name == 'release' | |
run: | | |
echo "RELEASE_VERSION=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_ENV | |
cp ./airgorah_${{ matrix.arch }}.deb ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.deb | |
cp ./airgorah_${{ matrix.arch }}.rpm ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.rpm | |
cp ./airgorah_${{ matrix.arch }}.pkg.tar.zst ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.pkg.tar.zst | |
- name: Upload packages | |
if: github.event_name == 'release' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.deb | |
./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.rpm | |
./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.pkg.tar.zst | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |