mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-07-26 05:46:59 +00:00
169 lines
5.4 KiB
YAML
169 lines
5.4 KiB
YAML
name: Flatter
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag_name:
|
|
description: "TAG (empty to build from current branch)"
|
|
required: false
|
|
type: string
|
|
build_branch:
|
|
description: "Flatpak branch to build (stable/nightly)"
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- stable
|
|
- nightly
|
|
default: "stable"
|
|
|
|
jobs:
|
|
build-flatpak:
|
|
name: Build Flatpak (${{ matrix.arch }})
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-latest
|
|
- arch: aarch64
|
|
runner: ubuntu-24.04-arm
|
|
fail-fast: false
|
|
runs-on: ${{ matrix.runner }}
|
|
permissions:
|
|
contents: read
|
|
container:
|
|
image: ghcr.io/andyholmes/flatter/freedesktop:25.08
|
|
options: --privileged
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.tag_name || github.ref }}
|
|
|
|
- name: Setup GPG
|
|
id: gpg
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
|
with:
|
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
|
|
|
- name: Set Default Branch
|
|
id: set_branch
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
|
echo "branch=stable" >> $GITHUB_OUTPUT
|
|
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
echo "branch=${{ inputs.build_branch }}" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "branch=nightly" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Modify Manifest
|
|
run: |
|
|
sed -i '/^branch:/d' packages/flatpak/ru.arabianq.pwsp.yaml
|
|
sed -i '/^default-branch:/d' packages/flatpak/ru.arabianq.pwsp.yaml
|
|
echo "branch: ${{ steps.set_branch.outputs.branch }}" >> packages/flatpak/ru.arabianq.pwsp.yaml
|
|
echo "default-branch: ${{ steps.set_branch.outputs.branch }}" >> packages/flatpak/ru.arabianq.pwsp.yaml
|
|
|
|
- name: Install SDK Extensions
|
|
run: |
|
|
flatpak install -y flathub org.freedesktop.Sdk.Extension.rust-stable//25.08
|
|
flatpak install -y flathub org.freedesktop.Sdk.Extension.llvm20//25.08
|
|
|
|
- name: Build Flatpak
|
|
uses: andyholmes/flatter@main
|
|
with:
|
|
files: packages/flatpak/ru.arabianq.pwsp.yaml
|
|
gpg-sign: ${{ steps.gpg.outputs.fingerprint }}
|
|
upload-bundles: true
|
|
upload-pages-artifact: false
|
|
arch: ${{ matrix.arch }}
|
|
cache: true
|
|
|
|
prepare-repo:
|
|
name: Prepare OSTree Repo
|
|
needs: build-flatpak
|
|
runs-on: ubuntu-latest
|
|
concurrency: gh-pages-deploy
|
|
container:
|
|
image: ghcr.io/andyholmes/flatter/freedesktop:25.08
|
|
options: --privileged
|
|
permissions:
|
|
contents: write # Needed to upload files to GitHub Release
|
|
|
|
steps:
|
|
- name: Download Flatpak Bundles
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: bundles
|
|
pattern: ru.arabianq.pwsp-*
|
|
|
|
- name: Checkout existing gh-pages
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: gh-pages
|
|
path: gh-pages-branch
|
|
continue-on-error: true
|
|
|
|
- name: Setup GPG
|
|
id: gpg
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
|
with:
|
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
|
|
|
- name: Update OSTree Repo and Prepare Release Bundles
|
|
run: |
|
|
mkdir -p release-bundles
|
|
|
|
# Inherit existing OSTree repository to preserve previous branches (e.g. stable vs nightly)
|
|
# Only inherit if objects/ exists, otherwise it's a corrupted/empty repo due to Git ignoring empty folders
|
|
if [ -d "gh-pages-branch/objects" ]; then
|
|
echo "Found existing OSTree repository. Copying..."
|
|
cp -r gh-pages-branch pages-repo
|
|
# Clean up the .git folder so it doesn't interfere
|
|
rm -rf pages-repo/.git
|
|
else
|
|
echo "Initializing new OSTree repository..."
|
|
mkdir -p pages-repo
|
|
ostree init --mode=archive-z2 --repo=pages-repo
|
|
fi
|
|
|
|
shopt -s nullglob
|
|
for dir in bundles/ru.arabianq.pwsp-*; do
|
|
arch=$(basename "$dir" | sed 's/ru.arabianq.pwsp-//')
|
|
|
|
# Find the flatpak file inside the dir
|
|
bundle=$(find "$dir" -name "*.flatpak" | head -n 1)
|
|
|
|
if [ -n "$bundle" ]; then
|
|
echo "Importing $bundle for architecture $arch..."
|
|
flatpak build-import-bundle pages-repo "$bundle"
|
|
|
|
# Copy with a unique name for GitHub Release
|
|
cp "$bundle" "release-bundles/ru.arabianq.pwsp-${arch}.flatpak"
|
|
fi
|
|
done
|
|
|
|
# Update summary and sign the repository
|
|
flatpak build-update-repo --generate-static-deltas --gpg-sign=${{ steps.gpg.outputs.fingerprint }} pages-repo
|
|
|
|
- name: Deploy Flatpak Repo to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./pages-repo
|
|
destination_dir: .
|
|
keep_files: true
|
|
|
|
- name: Upload bundles to GitHub Release
|
|
if: github.event_name == 'release'
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: release-bundles/*.flatpak
|
|
tag_name: ${{ github.event.release.tag_name }}
|