ci: Add comprehensive packaging matrix for .deb, .rpm, .AppImage, tarball, and .exe
This commit is contained in:
parent
c8c16c6bb7
commit
4d45a260d8
1 changed files with 50 additions and 17 deletions
67
.github/workflows/release.yml
vendored
67
.github/workflows/release.yml
vendored
|
|
@ -11,7 +11,7 @@ permissions:
|
|||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Build Linux Binaries & Packages
|
||||
name: Build Linux Packages (.tar.gz, .deb, .rpm, .AppImage)
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
|
|
@ -23,7 +23,8 @@ jobs:
|
|||
sudo apt-get install -y \
|
||||
pkg-config clang libva-dev \
|
||||
libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
|
||||
libpipewire-0.3-dev libgtk-3-dev libgtk-layer-shell-dev libxcb1-dev libasound2-dev
|
||||
libpipewire-0.3-dev libgtk-3-dev libgtk-layer-shell-dev libxcb1-dev libasound2-dev \
|
||||
rpm alien wget
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
|
@ -31,14 +32,36 @@ jobs:
|
|||
- name: Build Release Binaries
|
||||
run: cargo build --release
|
||||
|
||||
- name: Package Linux Tarball
|
||||
- name: Package Linux Tarball (Generic Binaries)
|
||||
run: |
|
||||
mkdir -p dist/vrec-linux-x86_64
|
||||
cp target/release/vrec-daemon target/release/vrec-ui dist/vrec-linux-x86_64/
|
||||
cp packaging/vrec.desktop dist/vrec-linux-x86_64/
|
||||
cp README.md dist/vrec-linux-x86_64/ 2>/dev/null || true
|
||||
tar -czvf dist/vrec-linux-x86_64.tar.gz -C dist vrec-linux-x86_64
|
||||
|
||||
- name: Build Debian Package (.deb)
|
||||
run: |
|
||||
mkdir -p deb/vrec_0.1.0/DEBIAN deb/vrec_0.1.0/usr/bin deb/vrec_0.1.0/usr/share/applications
|
||||
cat > deb/vrec_0.1.0/DEBIAN/control << 'EOF'
|
||||
Package: vrec
|
||||
Version: 0.1.0
|
||||
Section: video
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: oiupoyt
|
||||
Description: High-performance GPU hardware screen recorder and instant replay overlay
|
||||
Depends: libgtk-3-0, libgtk-layer-shell0, libpipewire-0.3-0, libva2, libasound2
|
||||
EOF
|
||||
cp target/release/vrec-daemon deb/vrec_0.1.0/usr/bin/
|
||||
cp target/release/vrec-ui deb/vrec_0.1.0/usr/bin/
|
||||
cp packaging/vrec.desktop deb/vrec_0.1.0/usr/share/applications/
|
||||
dpkg-deb --build deb/vrec_0.1.0 dist/vrec_0.1.0_amd64.deb
|
||||
|
||||
- name: Build RPM Package (.rpm)
|
||||
run: |
|
||||
alien --to-rpm --scripts dist/vrec_0.1.0_amd64.deb
|
||||
mv *.rpm dist/
|
||||
|
||||
- name: Package Standalone AppImage
|
||||
run: |
|
||||
mkdir -p AppDir/usr/bin AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/scalable/apps
|
||||
|
|
@ -46,7 +69,6 @@ jobs:
|
|||
cp target/release/vrec-daemon AppDir/usr/bin/
|
||||
cp packaging/vrec.desktop AppDir/usr/share/applications/
|
||||
|
||||
# Create AppRun launcher
|
||||
cat > AppDir/AppRun << 'EOF'
|
||||
#!/bin/sh
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
|
|
@ -54,26 +76,24 @@ jobs:
|
|||
EOF
|
||||
chmod +x AppDir/AppRun
|
||||
|
||||
# Generate dummy icon
|
||||
touch AppDir/usr/share/icons/hicolor/scalable/apps/media-record.svg
|
||||
touch AppDir/media-record.svg
|
||||
ln -s usr/share/applications/vrec.desktop AppDir/vrec.desktop
|
||||
|
||||
# Download appimagetool and build
|
||||
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool
|
||||
chmod +x appimagetool
|
||||
./appimagetool --appimage-extract-and-run AppDir dist/vrec-x86_64.AppImage || true
|
||||
|
||||
- name: Copy Packaging Blueprints
|
||||
run: |
|
||||
cp packaging/aur/PKGBUILD dist/ 2>/dev/null || true
|
||||
cp packaging/flatpak/com.vrec.Vrec.yaml dist/ 2>/dev/null || true
|
||||
|
||||
- name: Upload Linux Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-packages
|
||||
path: |
|
||||
dist/*.tar.gz
|
||||
dist/*.AppImage
|
||||
packaging/aur/PKGBUILD
|
||||
packaging/rpm/vrec.spec
|
||||
packaging/flatpak/com.vrec.Vrec.yaml
|
||||
path: dist/*
|
||||
|
||||
build-windows:
|
||||
name: Build Windows Binaries (.exe)
|
||||
|
|
@ -82,11 +102,22 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
update: true
|
||||
install: >-
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-rust
|
||||
mingw-w64-x86_64-gtk3
|
||||
mingw-w64-x86_64-ffmpeg
|
||||
mingw-w64-x86_64-pkg-config
|
||||
|
||||
- name: Build Release Binaries (Windows)
|
||||
run: cargo build --release
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cargo build --release
|
||||
|
||||
- name: Package Windows Zip
|
||||
shell: pwsh
|
||||
|
|
@ -105,7 +136,7 @@ jobs:
|
|||
publish-release:
|
||||
name: Publish GitHub Release
|
||||
needs: [build-linux, build-windows]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
|
|
@ -119,6 +150,8 @@ jobs:
|
|||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name != 'main' && github.ref_name || 'v0.1.0' }}
|
||||
name: "vrec ${{ github.ref_name != 'main' && github.ref_name || 'v0.1.0' }}"
|
||||
files: |
|
||||
artifacts/linux-packages/*
|
||||
artifacts/windows-package/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue