From 76e191806b490ebb2d6addf06d1b75aa315c39b4 Mon Sep 17 00:00:00 2001 From: Linard Schwendener Date: Sun, 20 Aug 2023 22:13:01 +0200 Subject: [PATCH] Properly Fill Release Info --- .github/workflows/publish.yml | 62 ++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 05d427d..f017162 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,30 +21,22 @@ jobs: cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' architecture: x64 -# - name: ๐Ÿ” Retrieve base64 keystore and decode it to a file -# env: -# KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGNING_KEY }} -# run: sudo bash -c 'base64 --decode <<< "$KEYSTORE_BASE64" > ${{ github.workspace }}/android/app/key.jks' -# - name: ๐Ÿ“๐Ÿ” Create keystore.properties file -# env: -# KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties -# run: | -# echo '${{ inputs.flavor }}StoreFile=key.jks' > $KEYSTORE_PROPERTIES_PATH -# echo '${{ inputs.flavor }}KeyAlias=${{ secrets.ANDROID_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH -# echo '${{ inputs.flavor }}StorePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH -# echo '${{ inputs.flavor }}KeyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH # This is seems to be only needed when running github actions locally with act # - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64 - - run: flutter pub get + - name: ๐Ÿ“ฅ Downloading Dependencies + run: flutter pub get # There are many issues currently that first need to be fixed to allow this rule # - run: flutter analyze --fatal-infos ./ - - run: dart format -o show --set-exit-if-changed ./ - - run: flutter test - - run: flutter build apk - - run: flutter build appbundle + - name: ๐Ÿ“ Format + run: dart format -o show --set-exit-if-changed ./ + - name: ๐Ÿงช Testing + run: flutter test + - name: ๐Ÿ› ๏ธ Build APK + run: flutter build apk + - name: ๐Ÿ› ๏ธ Build AppBundle + run: flutter build appbundle - name: ๐Ÿ” Sign app APK uses: r0adkll/sign-android-release@v1 - # ID used to access action output id: sign_app_apk with: releaseDirectory: ${{ github.workspace }}/build/app/outputs/apk/release @@ -52,11 +44,37 @@ jobs: alias: ${{ secrets.ANDROID_KEY_ALIAS }} keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} -# env: -# # override default build-tools version (29.0.3) -- optional -# BUILD_TOOLS_VERSION: "30.0.2" + - name: ๐Ÿ” Sign app AAB + uses: r0adkll/sign-android-release@v1 + id: sign_app_aab + with: + releaseDirectory: ${{ github.workspace }}/build/app/outputs/bundle/release + signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} + alias: ${{ secrets.ANDROID_KEY_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} + - name: ๐Ÿ—ƒ๏ธ Rename the Release File + uses: canastro/copy-file-action@master + with: + source: "${{ steps.sign_app_apk.outputs.signedReleaseFile }}" + target: "${{ github.workspace }}/app-release.apk" + - name: ๐Ÿ“„ Extract Version Number + id: flutter-version + uses: NiklasLehnfeld/flutter-version-number-action@main + with: + file-path: ${{ github.workspace }}/pubspec.yaml + - name: โœ‚๏ธ Split Version Number + uses: jungwinter/split@v1 + id: flutter-version-split + with: + msg: ${{ steps.flutter-version.outputs.version-number }} + separator: '+' - name: โฌ†๏ธ Github Release uses: softprops/action-gh-release@v1 with: + name: ${{ steps.flutter-version-split._0 }} + tag_name: ${{ steps.flutter-version-split._0 }} + body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ steps.flutter-version-split._1 }}.txt draft: true - files: ${{ steps.sign_app_apk.outputs.signedReleaseFile }} \ No newline at end of file + files: "${{ github.workspace }}/app-release.apk" + fail_on_unmatched_files: true