v2.23.0 #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Flatpak | |
on: | |
# Enable manual run | |
workflow_dispatch: | |
# Build & deploy for published releases | |
release: | |
types: | |
- published | |
# ${{ secrets.FLATHUB_TOKEN }} is a Personal Access Token to grant push access. | |
# ${{ secrets.GIT_AUTO_COMMIT_TOKEN }} is a Personal Access Token. | |
env: | |
project-id: codes.merritt.Nyrna | |
jobs: | |
update-recipe: | |
name: Update Flatpak recipe files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
path: code | |
token: ${{ secrets.GIT_AUTO_COMMIT_TOKEN }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y flatpak | |
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
sudo flatpak install -y flathub org.freedesktop.appstream-glib | |
- name: Setup Dart SDK | |
uses: dart-lang/[email protected] | |
# ---------------------- Update AppStream metadata file ---------------------- # | |
- name: Update metadata file | |
working-directory: ${{ github.workspace }}/code | |
run: | | |
dart pub global activate --source git https://github.com/Merrit/linux_packaging_updater.git | |
updater --projectId codes.merritt.Nyrna --repository nyrna --user merrit --metadata | |
- name: Commit updated AppStream metadata back to repo | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore: update linux metadata for new release" | |
file_pattern: "packaging/linux/*.metainfo.xml" | |
repository: code/ | |
# --------------------------- Create FlatHub update -------------------------- # | |
# Wait for the commit to be pushed to the repo | |
# | |
# This ensures the updated metadata file is available to the updater | |
# script when it runs, otherwise it has the wrong version number. | |
- name: Wait for commit to be pushed | |
run: sleep 60 | |
- name: Checkout flathub repository | |
uses: actions/checkout@v3 | |
with: | |
repository: flathub/${{ env.project-id }} | |
path: flathub | |
token: ${{ secrets.FLATHUB_TOKEN }} | |
- name: Update flatpak manifest | |
working-directory: ${{ github.workspace }}/flathub | |
run: updater --projectId codes.merritt.Nyrna --repository nyrna --user merrit --manifest | |
- name: Push updated recipe to Flathub | |
working-directory: ${{ github.workspace }}/flathub | |
env: | |
GH_TOKEN: ${{ secrets.FLATHUB_TOKEN }} | |
REPO_KEY: ${{ secrets.FLATHUB_TOKEN }} | |
USERNAME: merrit | |
run: | | |
git config --local user.name "Kristen McWilliam" | |
git config --local user.email "[email protected]" | |
git checkout -b flathub_update | |
git add -A | |
git commit -m "Update manifest" | |
git push -u origin flathub_update -f | |
gh pr create --fill --head flathub_update | |
# Disable auto-merge because they are disallowing it (╯°□°)╯︵ ┻━┻ | |
# https://discourse.flathub.org/t/enforcing-pull-request-workflow-and-green-ci-status-of-prs/3109 | |
# gh pr merge --rebase --delete-branch | |
# git push https://$USERNAME:[email protected]/flathub/${{ env.project-id }}.git |