Skip to content

Commit 7ab7d5c

Browse files
committed
Remove duplicated android release config file
1 parent 520b0b1 commit 7ab7d5c

File tree

2 files changed

+52
-110
lines changed

2 files changed

+52
-110
lines changed

.github/workflows/android-release-ng.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Google Play release
1+
name: Google Play release 2
22
on:
33
push:
4-
branches:
5-
- 'release/*'
4+
tags:
5+
- 'v[0-9]+.[0-9]+.[0-9]+'
66

77
jobs:
88
deploy_android:
@@ -14,45 +14,77 @@ jobs:
1414
- name: Setup Java
1515
uses: actions/setup-java@v1
1616
with:
17-
java-version: 12.x
17+
java-version: 11.x
1818

1919
- name: Setup Ruby
2020
uses: ruby/setup-ruby@v1
2121
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'
3023

3124
- name: Setup Flutter
3225
uses: subosito/flutter-action@v1
3326
with:
3427
channel: 'stable'
3528
flutter-version: '2.5.x'
3629

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
3944
4045
- name: Install Flutter dependencies
4146
run: flutter pub get
4247

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.
4362
- name: Bump version
44-
uses: maierj/[email protected]
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 }}
4874
4975
- name: Build AAB
5076
run: flutter build appbundle --release
5177
env:
5278
WGER_API_KEY: ${{ secrets.WGER_API_KEY }}
5379

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
5682
with:
5783
lane: production
5884
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

Comments
 (0)