ci(packaging): add safe AUR and Gentoo dry runs

cx
This commit is contained in:
vicrodh committed 2026-08-28 09:44:25 -06:00
1 parent d987aaa798
commit bf7a071073
2 files changed
+56 -2

No files matched your search

+28 -1
View File
@@ -16,6 +16,11 @@ on:
required: false
default: "1"
type: string
publish:
description: "Push the generated PKGBUILD/.SRCINFO to AUR"
required: false
default: false
type: boolean
concurrency:
group: aur-publish
@@ -117,9 +122,14 @@ jobs:
echo "aarch64 Checksum: $SHA256_AARCH64"
- name: Setup SSH for AUR
if: github.event_name == 'workflow_run' || inputs.publish
env:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: |
if [[ -z "$AUR_SSH_PRIVATE_KEY" ]]; then
echo "::error::AUR_SSH_PRIVATE_KEY is required when publishing"
exit 1
fi
mkdir -p ~/.ssh
echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
@@ -129,8 +139,14 @@ jobs:
ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts
- name: Clone AUR repo
env:
SHOULD_PUBLISH: ${{ github.event_name == 'workflow_run' || inputs.publish }}
run: |
git clone ssh://aur@aur.archlinux.org/qbz-bin.git /tmp/aur-qbz-bin
if [[ "$SHOULD_PUBLISH" == "true" ]]; then
git clone ssh://aur@aur.archlinux.org/qbz-bin.git /tmp/aur-qbz-bin
else
git clone https://aur.archlinux.org/qbz-bin.git /tmp/aur-qbz-bin
fi
cd /tmp/aur-qbz-bin
# Ensure we are on master (recover from detached HEAD if remote branch was corrupted)
git checkout master 2>/dev/null || git checkout -b master
@@ -188,6 +204,7 @@ jobs:
cat .SRCINFO
- name: Commit and push to AUR
if: github.event_name == 'workflow_run' || inputs.publish
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
@@ -197,3 +214,13 @@ jobs:
git add PKGBUILD .SRCINFO
git commit -m "Update to v${VERSION}"
git push
- name: Upload dry-run package metadata
if: github.event_name == 'workflow_dispatch' && !inputs.publish
uses: actions/upload-artifact@v7
with:
name: aur-qbz-bin-dry-run
path: |
/tmp/aur-qbz-bin/PKGBUILD
/tmp/aur-qbz-bin/.SRCINFO
if-no-files-found: error
+28 -1
View File
@@ -16,6 +16,11 @@ on:
description: "Version to publish (e.g. 1.2.0)"
required: true
type: string
publish:
description: "Push generated ebuilds and Manifests to qbz-overlay"
required: false
default: false
type: boolean
concurrency:
group: gentoo-overlay
@@ -61,8 +66,17 @@ jobs:
- name: Clone overlay repo
env:
OVERLAY_PAT: ${{ secrets.APT_REPO_TOKEN }}
SHOULD_PUBLISH: ${{ github.event_name == 'workflow_run' || inputs.publish }}
run: |
git clone "https://x-access-token:${OVERLAY_PAT}@github.com/vicrodh/qbz-overlay.git" /tmp/qbz-overlay
if [[ "$SHOULD_PUBLISH" == "true" ]]; then
if [[ -z "$OVERLAY_PAT" ]]; then
echo "::error::APT_REPO_TOKEN is required when publishing"
exit 1
fi
git clone "https://x-access-token:${OVERLAY_PAT}@github.com/vicrodh/qbz-overlay.git" /tmp/qbz-overlay
else
git clone https://github.com/vicrodh/qbz-overlay.git /tmp/qbz-overlay
fi
cd /tmp/qbz-overlay
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
@@ -177,6 +191,7 @@ jobs:
cat Manifest
- name: Commit and push
if: github.event_name == 'workflow_run' || inputs.publish
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
@@ -188,3 +203,15 @@ jobs:
fi
git commit -m "Update to v${VERSION}"
git push
- name: Upload dry-run overlay metadata
if: github.event_name == 'workflow_dispatch' && !inputs.publish
uses: actions/upload-artifact@v7
with:
name: gentoo-overlay-dry-run
path: |
/tmp/qbz-overlay/media-sound/qbz-bin/*.ebuild
/tmp/qbz-overlay/media-sound/qbz-bin/Manifest
/tmp/qbz-overlay/media-sound/qbz/*.ebuild
/tmp/qbz-overlay/media-sound/qbz/Manifest
if-no-files-found: error