mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
Implement AppImage Packaging in CI
This commit is contained in:
67
.github/workflows/package.yml
vendored
67
.github/workflows/package.yml
vendored
@@ -81,14 +81,15 @@ jobs:
|
||||
|
||||
- name: Test (release mode)
|
||||
if: matrix.os == 'macos' || matrix.os == 'ubuntu' || matrix.os == 'windows' && matrix.arch == 'amd64'
|
||||
run: |
|
||||
cargo test --release --verbose -- --nocapture &&
|
||||
cargo clean
|
||||
run: cargo test --release --verbose -- --nocapture &&
|
||||
|
||||
- name: Install Cross
|
||||
if: matrix.os == 'ubuntu'
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Clean
|
||||
run: cargo clean
|
||||
|
||||
- name: Build binary (Linux)
|
||||
if: matrix.os == 'ubuntu'
|
||||
run: cross build --release --target ${{ matrix.target }}
|
||||
@@ -158,6 +159,66 @@ jobs:
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
|
||||
appimage:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:latest
|
||||
options: --privileged
|
||||
needs: deb
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
appimgarch: x86_64
|
||||
- arch: arm64
|
||||
appimgarch: aarch64
|
||||
- arch: i386
|
||||
appimgarch: i686
|
||||
- arch: armhf
|
||||
appimgarch: armhf
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: apt-get update -y && apt-get install -y git build-essential graphicsmagick-imagemagick-compat wget file desktop-file-utils libfuse2
|
||||
|
||||
- name: Download Debian package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: deb-${{ matrix.arch }}
|
||||
path: /target/
|
||||
|
||||
- name: Download pkg2appimage
|
||||
shell: bash
|
||||
run: git clone https://github.com/AppImageCommunity/pkg2appimage.git
|
||||
|
||||
- name: Replace placeholders. pkg2appimage bundled implementation of apt update does not allow download of packages for different architectures by default. Override this.
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's/REPLACE_TAG/Sniffnet_LinuxDEB_${{ matrix.arch }}.deb/g' resources/packaging/linux/AppImage/sniffnet.yml
|
||||
sed -i -e 's/binary-${arch}/binary-${{ matrix.arch }}/g' pkg2appimage/functions.sh
|
||||
|
||||
- name: Repackage for AppImage
|
||||
shell: bash
|
||||
run: |
|
||||
cd pkg2appimage
|
||||
ARCH=${{ matrix.appimgarch }} FUNCTIONS_SH=$(pwd)/functions.sh ./pkg2appimage ../resources/packaging/linux/AppImage/sniffnet.yml
|
||||
mkdir /out
|
||||
mv out/*.AppImage /out/Sniffnet_LinuxAppImage_${{ matrix.arch }}.AppImage
|
||||
ls -lah /out
|
||||
pwd
|
||||
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: appimage-${{ matrix.arch }}
|
||||
path: /out/
|
||||
if-no-files-found: error
|
||||
|
||||
rpm:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
|
||||
Reference in New Issue
Block a user