-
-
Notifications
You must be signed in to change notification settings - Fork 17
91 lines (77 loc) · 3.29 KB
/
flatpak.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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/setup-dart@v1.3
# ---------------------- 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 "9575627+Merrit@users.noreply.github.com"
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:$REPO_KEY@github.com/flathub/${{ env.project-id }}.git