feat(flatpak): multi-OSTree pipeline — nightly, beta, stable

This commit is contained in:
openclaw_philipp
2026-06-27 16:53:53 +02:00
parent 8413a1296d
commit 45a589d29c
2 changed files with 96 additions and 23 deletions
+69 -8
View File
@@ -12,7 +12,7 @@ env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions: permissions:
contents: read contents: write
packages: write packages: write
jobs: jobs:
@@ -453,18 +453,79 @@ jobs:
path: flatpak-src/KST4Contest path: flatpak-src/KST4Contest
EOF EOF
- name: Build Flatpak bundle - name: Import Flatpak signing key
run: |
echo "${{ secrets.FLATPAK_GPG_PRIVATE_KEY }}" | gpg --batch --import
FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')
echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV"
- name: Build Flatpak repo (nightly)
run: | run: |
flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml
flatpak build-export target/flatpak-repo target/flatpak-build flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build nightly
flatpak build-bundle target/flatpak-repo "dist/${ASSET_BASENAME}-linux-x86_64.flatpak" de.x08.KST4Contest flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo
- name: Upload Flatpak artifact - name: Create flatpakref (nightly)
run: |
REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > "dist/de.x08.KST4Contest.nightly.flatpakref" << EOF
[Flatpak Ref]
Name=de.x08.KST4Contest
Branch=nightly
Title=KST4Contest (Nightly) ON4KST Chat Client
Url=${PAGES_URL}
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
GPGKey=${GPG_KEY_B64}
IsRuntime=false
EOF
- name: Upload flatpakref
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
with: with:
name: linux-flatpak name: flatpakref
path: dist/KST4Contest-*-linux-x86_64.flatpak path: dist/de.x08.KST4Contest.nightly.flatpakref
retention-days: 14
- name: Upload Flatpak OSTree repo
uses: actions/upload-artifact@v4.3.4
with:
name: flatpak-ostree-repo
path: target/flatpak-repo/
publish-flatpak-repo:
name: Publish Flatpak OSTree Repo (nightly)
runs-on: ubuntu-latest
needs: build-flatpak
steps:
- name: Download OSTree repo artifact
uses: actions/download-artifact@v4.1.3
with:
name: flatpak-ostree-repo
path: flatpak-ostree-repo/
- name: Checkout existing flatpak-repo branch
uses: actions/checkout@v4.1.7
with:
ref: flatpak-repo
path: existing-flatpak-repo
- name: Merge nightly build into flatpak-repo
run: |
cd existing-flatpak-repo
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# Copy the new OSTree build into the repo
rsync -a ../flatpak-ostree-repo/ ./
# Stage all changes (new/updated refs in OSTree)
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Nightly flatpak: $(echo ${{ github.sha }} | cut -c1-7)"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo
fi
build-macos-dmg: build-macos-dmg:
name: Build macOS DMG (${{ matrix.os }}) name: Build macOS DMG (${{ matrix.os }})
+26 -14
View File
@@ -408,10 +408,18 @@ jobs:
FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}') FLATPAK_GPG_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^fpr/{print $10; exit}')
echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV" echo "FLATPAK_GPG_KEY_ID=$FLATPAK_GPG_KEY_ID" >> "$GITHUB_ENV"
- name: Determine OSTree branch
run: |
if [[ "${{ github.ref_name }}" == beta-* ]]; then
echo "OSTREE_BRANCH=beta" >> "$GITHUB_ENV"
else
echo "OSTREE_BRANCH=stable" >> "$GITHUB_ENV"
fi
- name: Build Flatpak repo - name: Build Flatpak repo
run: | run: |
flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml flatpak-builder --force-clean target/flatpak-build target/de.x08.KST4Contest.yml
flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build stable flatpak build-export --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo target/flatpak-build "$OSTREE_BRANCH"
flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo flatpak build-update-repo --gpg-sign="$FLATPAK_GPG_KEY_ID" target/flatpak-repo
- name: Create flatpakref - name: Create flatpakref
@@ -419,11 +427,11 @@ jobs:
REPO_NAME="${GITHUB_REPOSITORY#*/}" REPO_NAME="${GITHUB_REPOSITORY#*/}"
PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/" PAGES_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${REPO_NAME}/"
GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0) GPG_KEY_B64=$(gpg --export "$FLATPAK_GPG_KEY_ID" | base64 -w 0)
cat > "dist/de.x08.KST4Contest.flatpakref" << EOF cat > "dist/de.x08.KST4Contest.${OSTREE_BRANCH}.flatpakref" << EOF
[Flatpak Ref] [Flatpak Ref]
Name=de.x08.KST4Contest Name=de.x08.KST4Contest
Branch=stable Branch=${OSTREE_BRANCH}
Title=KST4Contest ON4KST Chat Client Title=KST4Contest (${{ startsWith(github.ref_name, 'beta-') && 'Beta' || 'Release' }}) ON4KST Chat Client
Url=${PAGES_URL} Url=${PAGES_URL}
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
GPGKey=${GPG_KEY_B64} GPGKey=${GPG_KEY_B64}
@@ -434,7 +442,7 @@ jobs:
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
with: with:
name: flatpakref name: flatpakref
path: dist/de.x08.KST4Contest.flatpakref path: dist/de.x08.KST4Contest.*.flatpakref
- name: Upload Flatpak OSTree repo - name: Upload Flatpak OSTree repo
uses: actions/upload-artifact@v4.3.4 uses: actions/upload-artifact@v4.3.4
@@ -576,7 +584,7 @@ jobs:
path: dist/KST4Contest-${{ github.ref_name }}-manual-*.pdf path: dist/KST4Contest-${{ github.ref_name }}-manual-*.pdf
publish-flatpak-repo: publish-flatpak-repo:
name: Publish Flatpak OSTree Repo to GitHub Pages name: Publish Flatpak OSTree Repo (${{ github.ref_name }})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build-flatpak needs: build-flatpak
@@ -587,21 +595,25 @@ jobs:
name: flatpak-ostree-repo name: flatpak-ostree-repo
path: flatpak-ostree-repo/ path: flatpak-ostree-repo/
- name: Download flatpakref - name: Checkout existing flatpak-repo branch
uses: actions/download-artifact@v4.1.3 uses: actions/checkout@v4.1.7
with: with:
name: flatpakref ref: flatpak-repo
path: flatpak-ostree-repo/ path: existing-flatpak-repo
- name: Push to flatpak-repo branch - name: Merge build into flatpak-repo
run: | run: |
cd flatpak-ostree-repo cd existing-flatpak-repo
git init
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
rsync -a ../flatpak-ostree-repo/ ./
git add -A git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Flatpak repo: ${{ github.ref_name }}" git commit -m "Flatpak repo: ${{ github.ref_name }}"
git push --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:flatpak-repo
fi
release-tag: release-tag:
name: Publish Tagged Release name: Publish Tagged Release