Files
yaak/.github/workflows/flathub.yml
Gregory Schier f265b7a572 Simplify CI: metainfo releases only accumulate in Flathub repo
- Remove metainfo update from update-manifest.sh
- Remove CI step that committed metainfo back to app repo
- Revert permissions back to read-only
- CI now inserts release entry directly into Flathub repo's metainfo
2026-02-10 23:26:22 -08:00

68 lines
2.5 KiB
YAML

name: Update Flathub
on:
release:
types: [published]
permissions:
contents: read
jobs:
update-flathub:
name: Update Flathub manifest
runs-on: ubuntu-latest
# Only run for stable releases (skip betas/pre-releases)
if: ${{ !github.event.release.prerelease }}
steps:
- name: Checkout app repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install source generators
run: |
pip install flatpak-node-generator tomlkit aiohttp
git clone --depth 1 https://github.com/flatpak/flatpak-builder-tools flatpak/flatpak-builder-tools
- name: Run update-manifest.sh
run: bash flatpak/update-manifest.sh "${{ github.event.release.tag_name }}"
- name: Checkout Flathub repo
uses: actions/checkout@v4
with:
repository: flathub/app.yaak.Yaak
token: ${{ secrets.FLATHUB_TOKEN }}
path: flathub-repo
- name: Copy updated files to Flathub repo
env:
VERSION: ${{ github.event.release.tag_name }}
run: |
cp flatpak/app.yaak.Yaak.yml flathub-repo/
cp flatpak/cargo-sources.json flathub-repo/
cp flatpak/node-sources.json flathub-repo/
cp LICENSE flathub-repo/
# Rewrite paths for Flathub repo flat structure
sed -i 's|path: \.\./LICENSE|path: LICENSE|' flathub-repo/app.yaak.Yaak.yml
sed -i 's|install -Dm644 flatpak/app.yaak.Yaak.metainfo.xml|install -Dm644 app.yaak.Yaak.metainfo.xml|' flathub-repo/app.yaak.Yaak.yml
sed -i '/path: LICENSE/a\ # Metainfo file (with release history)\n - type: file\n path: app.yaak.Yaak.metainfo.xml' flathub-repo/app.yaak.Yaak.yml
# Add new release to Flathub metainfo (accumulates over time)
sed -i "s| <releases>| <releases>\n <release version=\"${VERSION#v}\" date=\"$(date +%Y-%m-%d)\" />|" flathub-repo/app.yaak.Yaak.metainfo.xml
- name: Commit and push to Flathub
working-directory: flathub-repo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --quiet && echo "No changes to commit" && exit 0
git commit -m "Update to ${{ github.event.release.tag_name }}"
git push