1
- name : Google Play release
1
+ name : Google Play release 2
2
2
on :
3
3
push :
4
- branches :
5
- - ' release/* '
4
+ tags :
5
+ - ' v[0-9]+.[0-9]+.[0-9]+ '
6
6
7
7
jobs :
8
8
deploy_android :
@@ -14,45 +14,77 @@ jobs:
14
14
- name : Setup Java
15
15
uses : actions/setup-java@v1
16
16
with :
17
- java-version : 12 .x
17
+ java-version : 11 .x
18
18
19
19
- name : Setup Ruby
20
20
uses : ruby/setup-ruby@v1
21
21
with :
22
- ruby-version : ' 2.7'
23
-
24
- - name : Decrypt config files
25
- run : cd ./android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
26
- env :
27
- DECRYPTKEY_PLAYSTORE : ${{ secrets.DECRYPTKEY_PLAYSTORE }}
28
- DECRYPTKEY_PLAYSTORE_SIGNING_KEY : ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }}
29
- DECRYPTKEY_PROPERTIES : ${{ secrets.DECRYPTKEY_PROPERTIES }}
22
+ ruby-version : ' 3'
30
23
31
24
- name : Setup Flutter
32
25
uses : subosito/flutter-action@v1
33
26
with :
34
27
channel : ' stable'
35
28
flutter-version : ' 2.5.x'
36
29
37
- - run : dart --version
38
- - run : flutter --version
30
+ - name : Decrypt config files
31
+ run : |
32
+ cd ./android/fastlane/envfiles
33
+ chmod +x ./decrypt_secrets.sh
34
+ ./decrypt_secrets.sh
35
+ env :
36
+ DECRYPTKEY_PLAYSTORE : ${{ secrets.DECRYPTKEY_PLAYSTORE }}
37
+ DECRYPTKEY_PLAYSTORE_SIGNING_KEY : ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }}
38
+ DECRYPTKEY_PROPERTIES : ${{ secrets.DECRYPTKEY_PROPERTIES }}
39
+
40
+ - name : Flutter info
41
+ run : |
42
+ dart --version
43
+ flutter --version
39
44
40
45
- name : Install Flutter dependencies
41
46
run : flutter pub get
42
47
48
+ - name : Extract version information
49
+ id : get_version
50
+ run : |
51
+ echo ::set-output name=VERSION_V::$(echo $GITHUB_REF | cut -d / -f 3)
52
+ echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 2-)
53
+ echo ::set-output name=BUILD::$(flutter pub run cider version | cut -d '+' -f 2)
54
+
55
+ # Note: the original tag that triggered the workflow is in the form vX.Y.Z
56
+ # but the pubspec.yaml is committed in the commit after that one.
57
+ # Since we need the tag to point to the correct commit for other workflows
58
+ # such as f-droid we need a way to correct it. Only moving the tag
59
+ # would not work, as it would trigger this workflow again. So as
60
+ # a workaround, we use the v-tag to trigger this workflow, add a new
61
+ # one without the v and push it.
43
62
- name : Bump version
44
-
45
- with :
46
- lane : setVersion
47
- subdirectory : android
63
+ run : |
64
+ flutter pub run cider version ${{ steps.get_version.outputs.VERSION }}+${{ steps.get_version.outputs.BUILD }}
65
+ flutter pub run cider bump build
66
+
67
+ git config user.name Github-actions
68
+ git config user.email [email protected]
69
+ git add .
70
+ git commit -m "Bump version to $( flutter pub run cider version )"
71
+ git tag ${{ steps.get_version.outputs.VERSION }}
72
+ git push origin HEAD:master --tags
73
+ git push origin --delete ${{ steps.get_version.outputs.VERSION_V }}
48
74
49
75
- name : Build AAB
50
76
run : flutter build appbundle --release
51
77
env :
52
78
WGER_API_KEY : ${{ secrets.WGER_API_KEY }}
53
79
54
- - name : Run Fastlane
55
- uses : maierj/fastlane-action@v2.0.0
80
+ - name : Upload build to Play Store
81
+ uses : maierj/fastlane-action@v2
56
82
with :
57
83
lane : production
58
84
subdirectory : android
85
+
86
+ - name : Make Github release
87
+ uses : softprops/action-gh-release@v1
88
+ with :
89
+ files : build/app/outputs/bundle/release/app-release.aab
90
+ tag_name : ${{ steps.get_version.outputs.VERSION }}
0 commit comments