1
- name : Google Play release
1
+ name : Build release artefacts
2
2
on :
3
3
push :
4
4
tags :
5
5
- ' v[0-9]+.[0-9]+.[0-9]+'
6
6
7
+ defaults :
8
+ run :
9
+ working-directory : wger
10
+
7
11
jobs :
8
12
deploy_android :
9
13
runs-on : ubuntu-latest
10
14
steps :
11
- - name : Checkout code
15
+ - name : Checkout application code
12
16
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
13
25
14
26
- name : Setup Java
15
27
uses : actions/setup-java@v1
@@ -19,13 +31,21 @@ jobs:
19
31
- name : Setup Ruby
20
32
uses : ruby/setup-ruby@v1
21
33
with :
22
- ruby-version : ' 3 '
34
+ ruby-version : 3
23
35
24
36
- name : Setup Flutter
25
37
uses : subosito/flutter-action@v1
26
38
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
29
49
30
50
- name : Decrypt config files
31
51
run : |
@@ -37,39 +57,24 @@ jobs:
37
57
DECRYPTKEY_PLAYSTORE_SIGNING_KEY : ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }}
38
58
DECRYPTKEY_PROPERTIES : ${{ secrets.DECRYPTKEY_PROPERTIES }}
39
59
40
- - name : Flutter info
41
- run : |
42
- dart --version
43
- flutter --version
44
-
45
- - name : Install Flutter dependencies
46
- run : flutter pub get
47
-
48
60
- name : Extract version information
49
61
run : |
50
62
echo "VERSION_V=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
51
63
echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-)" >> $GITHUB_ENV
52
64
echo "BUILD=$(flutter pub run cider version | cut -d '+' -f 2)" >> $GITHUB_ENV
53
65
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
62
67
run : |
63
68
flutter pub run cider version ${{ env.VERSION }}+${{ env.BUILD }}
64
69
flutter pub run cider bump build
65
70
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
73
78
74
79
- name : Build AAB
75
80
run : flutter build appbundle --release
84
89
- name : Make Github release
85
90
uses : softprops/action-gh-release@v1
86
91
with :
87
- files : build/app/outputs/bundle/release/app-release.aab
88
92
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 : flathub
113
+ destination-repository-name : de.wger.flutter
114
+
115
+ target-branch : flathub-${{ env.VERSION }}
116
+ create-target-branch-if-needed : true
117
+ commit-message : Update de.wger.flutter.json
118
+
119
+ # Note: the original tag that triggered the workflow is in the form vX.Y.Z
120
+ # but the pubspec.yaml is committed in the commit after that one.
121
+ # Since we need the tag to point to the correct commit for other workflows
122
+ # such as f-droid we need a way to correct it. Only moving the tag
123
+ # would not work, as it would trigger this workflow again. So as
124
+ # a workaround, we use the v-tag to trigger this workflow, add a new
125
+ # one without the v and push it.
126
+ - name : Commit pubspec version and delete branch
127
+ run : |
128
+ git config user.name Github-actions
129
+ git config user.email [email protected]
130
+ git add .
131
+ git commit -m "Bump version to $( flutter pub run cider version )"
132
+ git tag ${{ env.VERSION }}
133
+ git push origin HEAD:master --tags
134
+ git push origin --delete ${{ env.VERSION_V }}
0 commit comments