ci: add release-gentoo workflow for overlay auto-update

Triggered by release-linux completion (same as AUR).
Updates ebuilds in vicrodh/qbz-overlay with new version.
Requires OVERLAY_PAT secret for cross-repo push.

cc
This commit is contained in:
vicrodh committed 2026-03-22 22:55:49 -06:00
1 parent 72b794a81c
commit 346db3785e
3 files changed
+281

No files matched your search

+99
View File
@@ -0,0 +1,99 @@
name: release-gentoo
on:
workflow_run:
workflows: ["release-linux"]
types: [completed]
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g. 1.2.0)"
required: true
type: string
concurrency:
group: gentoo-overlay
cancel-in-progress: false
permissions:
contents: read
jobs:
update-overlay:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') && !contains(github.event.workflow_run.head_branch, '-rc')) }}
steps:
- name: Checkout app repo
uses: actions/checkout@v4
- name: Determine version
id: version
env:
EVENT_NAME: ${{ github.event_name }}
WORKFLOW_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
DISPATCH_VERSION: ${{ inputs.version }}
run: |
if [[ "$EVENT_NAME" == "workflow_run" ]]; then
REF="$WORKFLOW_HEAD_BRANCH"
if [[ ! "$REF" =~ ^v[0-9]+(\.[0-9]+){1,3}([.-][0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid tag: $REF"
exit 1
fi
VERSION="${REF#v}"
else
VERSION="$DISPATCH_VERSION"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Version: $VERSION"
- name: Clone overlay repo
env:
OVERLAY_PAT: ${{ secrets.OVERLAY_PAT }}
run: |
git clone "https://x-access-token:${OVERLAY_PAT}@github.com/vicrodh/qbz-overlay.git" /tmp/qbz-overlay
cd /tmp/qbz-overlay
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Update binary ebuild
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
cd /tmp/qbz-overlay/media-sound/qbz-bin
# Remove old version ebuilds (keep metadata.xml)
rm -f qbz-bin-*.ebuild
# Copy template from app repo and update version
cp "${{ github.workspace }}/packaging/gentoo/qbz-bin.ebuild.template" "qbz-bin-${VERSION}.ebuild"
echo "=== qbz-bin-${VERSION}.ebuild ==="
cat "qbz-bin-${VERSION}.ebuild"
- name: Update source ebuild
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
cd /tmp/qbz-overlay/media-sound/qbz
# Remove old version ebuilds (keep metadata.xml)
rm -f qbz-*.ebuild
# Copy template from app repo and update version
cp "${{ github.workspace }}/packaging/gentoo/qbz.ebuild.template" "qbz-${VERSION}.ebuild"
echo "=== qbz-${VERSION}.ebuild ==="
cat "qbz-${VERSION}.ebuild"
- name: Commit and push
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
cd /tmp/qbz-overlay
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "Update to v${VERSION}"
git push