scythe/.github/workflows/release.yml

127 lines
4 KiB
YAML

name: Release & Packaging
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux:
name: Build Linux Binaries & Packages
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
sudo apt-get update
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
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build Release Binaries
run: cargo build --release
- name: Package Linux Tarball
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: Package Standalone AppImage
run: |
mkdir -p AppDir/usr/bin AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/scalable/apps
cp target/release/vrec-ui AppDir/usr/bin/
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}")")"
exec "${HERE}/usr/bin/vrec-ui" "$@"
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: 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
build-windows:
name: Build Windows Binaries (.exe)
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build Release Binaries (Windows)
run: cargo build --release
- name: Package Windows Zip
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist/vrec-windows-x64
Copy-Item target/release/vrec-daemon.exe dist/vrec-windows-x64/
Copy-Item target/release/vrec-ui.exe dist/vrec-windows-x64/
Compress-Archive -Path dist/vrec-windows-x64 -DestinationPath dist/vrec-windows-x64.zip
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-package
path: dist/vrec-windows-x64.zip
publish-release:
name: Publish GitHub Release
needs: [build-linux, build-windows]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all built artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/linux-packages/*
artifacts/windows-package/*
draft: false
prerelease: false
generate_release_notes: true