Skip to content
This repository was archived by the owner on Sep 14, 2024. It is now read-only.

Commit 9a454da

Browse files
authored
Merge pull request #210 from Teifun2/ci-release
Ci release
2 parents ee9dbf4 + 54de234 commit 9a454da

3 files changed

Lines changed: 89 additions & 42 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,31 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-java@v3
12+
- name: ⬇️ Checkout repository
13+
uses: actions/checkout@v3
14+
- name: ⚙️ Setup Java
15+
uses: actions/setup-java@v3
1416
with:
1517
java-version: '12.x'
1618
distribution: 'adopt'
1719
cache: 'gradle'
18-
- uses: subosito/flutter-action@v2
20+
- name: ⚙️ Setup Flutter
21+
uses: subosito/flutter-action@v2
1922
with:
2023
channel: 'stable'
2124
cache: true
2225
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
2326
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
2427
architecture: x64
25-
# This is seems to be only needed when running github actions locally with act
26-
# - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64
27-
- run: flutter pub get
28-
# There are many issues currently that first need to be fixed to allow this rule
29-
# - run: flutter analyze --fatal-infos ./
30-
- run: dart format -o show --set-exit-if-changed ./
31-
- run: flutter test
32-
- run: flutter build apk --debug
28+
# This is seems to be only needed when running github actions locally with act
29+
# - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64
30+
- name: 📥 Downloading Dependencies
31+
run: flutter pub get
32+
# There are many issues currently that first need to be fixed to allow this rule
33+
# - run: flutter analyze --fatal-infos ./
34+
- name: 📝 Format
35+
run: dart format -o none --set-exit-if-changed ./
36+
- name: 🧪 Testing
37+
run: flutter test
38+
- name: 🛠️ Build APK
39+
run: flutter build apk --debug

.github/workflows/publish.yml

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,69 @@ jobs:
2121
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
2222
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
2323
architecture: x64
24-
- name: 🔐 Retrieve base64 keystore and decode it to a file
25-
env:
26-
KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGNING_KEY }}
27-
run: sudo bash -c 'base64 --decode <<< "$KEYSTORE_BASE64" > ${{ github.workspace }}/android/app/key.jks'
28-
- name: 📝🔐 Create keystore.properties file
29-
env:
30-
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties
31-
run: |
32-
echo '${{ inputs.flavor }}StoreFile=key.jks' > $KEYSTORE_PROPERTIES_PATH
33-
echo '${{ inputs.flavor }}KeyAlias=${{ secrets.ANDROID_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH
34-
echo '${{ inputs.flavor }}StorePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
35-
echo '${{ inputs.flavor }}KeyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
3624
# This is seems to be only needed when running github actions locally with act
3725
# - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64
38-
- run: flutter pub get
26+
- name: 📥 Downloading Dependencies
27+
run: flutter pub get
3928
# There are many issues currently that first need to be fixed to allow this rule
4029
# - run: flutter analyze --fatal-infos ./
41-
- run: dart format -o show --set-exit-if-changed ./
42-
- run: flutter test
43-
- run: flutter build apk
44-
- run: flutter build appbundle
30+
- name: 📝 Format
31+
run: dart format -o none --set-exit-if-changed ./
32+
- name: 🧪 Testing
33+
run: flutter test
34+
- name: 🛠️ Build APK
35+
run: flutter build apk
36+
- name: 🛠️ Build AppBundle
37+
run: flutter build appbundle
38+
- name: 🔐 Sign app APK
39+
uses: r0adkll/sign-android-release@v1
40+
id: sign_app_apk
41+
with:
42+
releaseDirectory: ${{ github.workspace }}/build/app/outputs/apk/release
43+
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
44+
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
45+
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
46+
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
47+
- name: 🔐 Sign app AAB
48+
uses: r0adkll/sign-android-release@v1
49+
id: sign_app_aab
50+
with:
51+
releaseDirectory: ${{ github.workspace }}/build/app/outputs/bundle/release
52+
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
53+
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
54+
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
55+
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
56+
- name: 🗃️ Rename the Release File
57+
run: cp ${{ steps.sign_app_apk.outputs.signedReleaseFile }} ${{ github.workspace }}/app-release.apk
58+
- name: 📄 Extract Version Number
59+
id: flutter-version
60+
uses: NiklasLehnfeld/flutter-version-number-action@main
61+
with:
62+
file-path: ${{ github.workspace }}/pubspec.yaml
63+
- name: ✂️ Split Version Number
64+
uses: jungwinter/split@v1
65+
id: flutter-version-split
66+
with:
67+
msg: ${{ steps.flutter-version.outputs.version-number }}
68+
seperator: '+'
4569
- name: ⬆️ Github Release
4670
uses: softprops/action-gh-release@v1
4771
with:
72+
name: ${{ steps.flutter-version-split.outputs._0 }}
73+
tag_name: ${{ steps.flutter-version-split.outputs._0 }}
74+
body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ steps.flutter-version-split.outputs._1 }}.txt
4875
draft: true
49-
files: ${{ github.workspace }}/build/app/outputs/apk/release/app-release.apk
76+
files: "${{ github.workspace }}/app-release.apk"
77+
fail_on_unmatched_files: true
78+
# Prepared for the Automatic Upload to Google Play Store
79+
# - name: 🚀 Upload Release to Google Play Store
80+
# uses: r0adkll/upload-google-play@v1
81+
# with:
82+
# serviceAccountJsonPlainText: ${{ SERVICE_ACCOUNT_JSON }}
83+
# packageName: com.example.MyApp
84+
# releaseFiles: app/build/outputs/bundle/release/app-release.aab
85+
# track: production
86+
# status: inProgress
87+
# whatsNewDirectory: distribution/whatsnew
88+
# mappingFile: app/build/outputs/mapping/release/mapping.txt
89+
# debugSymbols: app/intermediates/merged_native_libs/release/out/lib

android/app/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ android {
4242
versionName flutterVersionName
4343
}
4444

45-
signingConfigs {
46-
release {
47-
keyAlias keystoreProperties['keyAlias']
48-
keyPassword keystoreProperties['keyPassword']
49-
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
50-
storePassword keystoreProperties['storePassword']
51-
}
52-
}
53-
buildTypes {
54-
release {
55-
signingConfig signingConfigs.release
56-
}
57-
}
45+
// signingConfigs {
46+
// release {
47+
// keyAlias keystoreProperties['keyAlias']
48+
// keyPassword keystoreProperties['keyPassword']
49+
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
50+
// storePassword keystoreProperties['storePassword']
51+
// }
52+
// }
53+
// buildTypes {
54+
// release {
55+
// signingConfig signingConfigs.release
56+
// }
57+
// }
5858
}
5959

6060
flutter {

0 commit comments

Comments
 (0)