Skip to content

Commit 823b3aa

Browse files
committed
Update release workflow file to also build flathub packages
1 parent 9851ab3 commit 823b3aa

File tree

2 files changed

+77
-32
lines changed

2 files changed

+77
-32
lines changed

.github/workflows/android-release.yml

Lines changed: 73 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@ on:
44
tags:
55
- 'v[0-9]+.[0-9]+.[0-9]+'
66

7+
defaults:
8+
run:
9+
working-directory: wger
10+
711
jobs:
812
deploy_android:
913
runs-on: ubuntu-latest
1014
steps:
11-
- name: Checkout code
15+
- name: Checkout application code
1216
uses: actions/checkout@v2
17+
with:
18+
path: wger
19+
20+
- name: Checkout flathub repo
21+
uses: actions/checkout@v3
22+
with:
23+
repository: wger-project/test
24+
path: flathub
1325

1426
- name: Setup Java
1527
uses: actions/setup-java@v1
@@ -19,13 +31,21 @@ jobs:
1931
- name: Setup Ruby
2032
uses: ruby/setup-ruby@v1
2133
with:
22-
ruby-version: '3'
34+
ruby-version: 3
2335

2436
- name: Setup Flutter
2537
uses: subosito/flutter-action@v1
2638
with:
27-
channel: 'stable'
28-
flutter-version: '3.7.x'
39+
channel: stable
40+
flutter-version: 3.7.x
41+
42+
- name: Flutter info
43+
run: |
44+
dart --version
45+
flutter --version
46+
47+
- name: Install Flutter dependencies
48+
run: flutter pub get
2949

3050
- name: Decrypt config files
3151
run: |
@@ -37,39 +57,24 @@ jobs:
3757
DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }}
3858
DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }}
3959

40-
- name: Flutter info
41-
run: |
42-
dart --version
43-
flutter --version
44-
45-
- name: Install Flutter dependencies
46-
run: flutter pub get
47-
4860
- name: Extract version information
4961
run: |
5062
echo "VERSION_V=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
5163
echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-)" >> $GITHUB_ENV
5264
echo "BUILD=$(flutter pub run cider version | cut -d '+' -f 2)" >> $GITHUB_ENV
5365
54-
# Note: the original tag that triggered the workflow is in the form vX.Y.Z
55-
# but the pubspec.yaml is committed in the commit after that one.
56-
# Since we need the tag to point to the correct commit for other workflows
57-
# such as f-droid we need a way to correct it. Only moving the tag
58-
# would not work, as it would trigger this workflow again. So as
59-
# a workaround, we use the v-tag to trigger this workflow, add a new
60-
# one without the v and push it.
61-
- name: Bump version
66+
- name: Bump pubspec version
6267
run: |
6368
flutter pub run cider version ${{ env.VERSION }}+${{ env.BUILD }}
6469
flutter pub run cider bump build
6570
66-
git config user.name Github-actions
67-
git config user.email [email protected]
68-
git add .
69-
git commit -m "Bump version to $( flutter pub run cider version )"
70-
git tag ${{ env.VERSION }}
71-
git push origin HEAD:master --tags
72-
git push origin --delete ${{ env.VERSION_V }}
71+
- name: Build application for linux
72+
run: |
73+
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
74+
flutter build linux --release
75+
cd flatpak/scripts
76+
dart pub get
77+
dart flatpak_packager.dart --meta ../flatpak_meta.json --github
7378
7479
- name: Build AAB
7580
run: flutter build appbundle --release
@@ -84,6 +89,45 @@ jobs:
8489
- name: Make Github release
8590
uses: softprops/action-gh-release@v1
8691
with:
87-
files: build/app/outputs/bundle/release/app-release.aab
8892
tag_name: ${{ env.VERSION }}
89-
body_path: CHANGELOG.md
93+
body_path: CHANGELOG.md
94+
files: |
95+
build/app/outputs/bundle/release/app-release.aab
96+
flatpak/scripts/flatpak_generator_exports/wger-linux-x86_64.tar.gz
97+
flatpak/scripts/flatpak_generator_exports/wger-linux-x86_64.sha256
98+
99+
- name: Generate flathub manifest
100+
run: |
101+
cd flatpak/scripts
102+
dart pub get
103+
dart manifest_generator.dart --meta ../flatpak_meta.json --github
104+
cp flatpak_generator_exports/de.wger.flutter.json ../../../flathub
105+
106+
- name: Push config to flathub repository
107+
uses: cpina/github-action-push-to-another-repository@main
108+
env:
109+
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
110+
with:
111+
source-directory: flathub
112+
destination-github-username: wger-project
113+
destination-repository-name: test
114+
user-email: [email protected]
115+
target-branch: master
116+
commit-message: Update de.wger.flutter.json
117+
118+
# Note: the original tag that triggered the workflow is in the form vX.Y.Z
119+
# but the pubspec.yaml is committed in the commit after that one.
120+
# Since we need the tag to point to the correct commit for other workflows
121+
# such as f-droid we need a way to correct it. Only moving the tag
122+
# would not work, as it would trigger this workflow again. So as
123+
# a workaround, we use the v-tag to trigger this workflow, add a new
124+
# one without the v and push it.
125+
- name: Commit pubspec version and delete branch
126+
run: |
127+
git config user.name Github-actions
128+
git config user.email [email protected]
129+
git add .
130+
git commit -m "Bump version to $( flutter pub run cider version )"
131+
git tag ${{ env.VERSION }}
132+
git push origin HEAD:master --tags
133+
git push origin --delete ${{ env.VERSION_V }}

.github/workflows/flathub-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
with:
2222
repository: wger-project/test
2323
path: flathub
24+
2425
- name: Setup Java
2526
uses: actions/setup-java@v1
2627
with:
@@ -56,8 +57,8 @@ jobs:
5657
flutter build linux --release
5758
cd flatpak/scripts
5859
dart pub get
59-
dart flatpak_packager.dart --meta ../flatpak_meta.json --github -n pubspec.yaml
60-
dart manifest_generator.dart --meta ../flatpak_meta.json --github -n pubspec.yaml
60+
dart flatpak_packager.dart --meta ../flatpak_meta.json --github
61+
dart manifest_generator.dart --meta ../flatpak_meta.json --github
6162
6263
cp flatpak_generator_exports/de.wger.flutter.json ../../../flathub
6364
ls flatpak_generator_exports/wger-linux-x86_64.sha256
@@ -86,7 +87,7 @@ jobs:
8687
- name: Upload SHA256 checksum archive
8788
uses: actions/upload-artifact@v3
8889
with:
89-
name: Flatpak file
90+
name: Flatpak checksum file
9091
path: wger/flatpak/scripts/flatpak_generator_exports/wger-linux-x86_64.sha256
9192

9293
#- name: Build AAB

0 commit comments

Comments
 (0)