mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 09:00:35 +02:00
106 lines
3.9 KiB
YAML
106 lines
3.9 KiB
YAML
name: release
|
|
|
|
# Pushing a v* tag builds Frame Control for macOS, Windows and Linux and attaches
|
|
# the installers to that tag's GitHub release (created as a draft if missing).
|
|
# Pull requests that touch the app build the same installers as artifacts.
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
pull_request:
|
|
paths: ["app/**", "ui/**", "desktop/**", "mac/**", "scripts/**", "frame/**", "apk-catalog/**", ".github/workflows/release.yml"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
script: dist
|
|
files: app/dist/*.dmg app/dist/*.zip
|
|
- os: windows-latest
|
|
script: dist:win
|
|
files: app/dist/*.exe app/dist/*.zip
|
|
- os: ubuntu-latest
|
|
script: dist:linux
|
|
files: app/dist/*.AppImage app/dist/*.deb
|
|
- os: ubuntu-24.04-arm
|
|
script: dist:linux:arm64
|
|
files: app/dist/*.AppImage app/dist/*.deb
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "24"
|
|
- name: Linux streaming libraries
|
|
if: runner.os == 'Linux'
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libglib2.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-pipewire libpipewire-0.3-modules libspa-0.2-modules
|
|
arch=x64; if [ "$(uname -m)" = aarch64 ]; then arch=arm64; fi
|
|
python3 desktop/build.py --out "app/build/desktop/linux-$arch"
|
|
- uses: msys2/setup-msys2@v2
|
|
if: runner.os == 'Windows'
|
|
with:
|
|
msystem: UCRT64
|
|
update: true
|
|
install: >-
|
|
mingw-w64-ucrt-x86_64-gcc
|
|
mingw-w64-ucrt-x86_64-pkgconf
|
|
mingw-w64-ucrt-x86_64-python
|
|
mingw-w64-ucrt-x86_64-gstreamer
|
|
mingw-w64-ucrt-x86_64-gst-plugins-base
|
|
mingw-w64-ucrt-x86_64-gst-plugins-good
|
|
mingw-w64-ucrt-x86_64-gst-plugins-bad
|
|
mingw-w64-ucrt-x86_64-gst-plugins-ugly
|
|
- name: Windows streaming libraries
|
|
if: runner.os == 'Windows'
|
|
shell: msys2 {0}
|
|
run: python desktop/build.py --out app/build/desktop/win-x64
|
|
- name: Build
|
|
working-directory: app
|
|
shell: bash
|
|
run: npm ci && npm run ${{ matrix.script }}
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
- name: Test the bundled Python with the native PC libraries
|
|
if: runner.os != 'macOS'
|
|
shell: bash
|
|
run: |
|
|
if [ "$RUNNER_OS" = Windows ]; then
|
|
platform=win; arch=x64
|
|
python="$PWD/app/build/deps/win-x64/python/python.exe"
|
|
native="$(cygpath -w "$PWD/app/build/desktop/win-x64")"
|
|
else
|
|
platform=linux; arch=x64
|
|
if [ "$(uname -m)" = aarch64 ]; then arch=arm64; fi
|
|
python="$PWD/app/build/deps/linux-$arch/python/bin/python3"
|
|
native="$PWD/app/build/desktop/linux-$arch"
|
|
fi
|
|
FRAME_PC_NATIVE="$native" FRAME_PC_REQUIRE_NATIVE=1 "$python" -m unittest discover -s tests -p 'test_pc*.py' -v
|
|
- name: Upload to the release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
tag="${GITHUB_REF_NAME}"
|
|
gh release view "$tag" >/dev/null 2>&1 || gh release create "$tag" --draft --title "Frame Control ${tag#v}" --notes ""
|
|
gh release upload "$tag" ${{ matrix.files }} --clobber
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: frame-control-${{ matrix.os }}
|
|
path: |
|
|
app/dist/*.dmg
|
|
app/dist/*.exe
|
|
app/dist/*.zip
|
|
app/dist/*.AppImage
|
|
app/dist/*.deb
|
|
if-no-files-found: ignore
|