From 5e44b2d7ae094044062dea1252f1d88ae3dbb154 Mon Sep 17 00:00:00 2001 From: Omid Marfavi <21163286+marfavi@users.noreply.github.com> Date: Sat, 14 Oct 2023 22:31:25 +0200 Subject: [PATCH 1/3] Release dev/prod versions off a main branch (#517) - Development releases are triggered by commits to the main branch - Productions releases are triggered by new Github releases Co-authored-by: Jonas Anker Rasmussen --- .github/scripts/build-dev.sh | 9 ++ .github/scripts/build-prod.sh | 10 ++ .../{setup-certs.command => setup-certs.sh} | 0 .github/workflows/build.yml | 103 +++++---------- .github/workflows/codesee-arch-diagram.yml | 2 +- .github/workflows/release-dev.yml | 53 ++++++++ .github/workflows/release-prod.yml | 59 +++++++++ .github/workflows/release.yml | 123 ------------------ 8 files changed, 167 insertions(+), 192 deletions(-) create mode 100755 .github/scripts/build-dev.sh create mode 100755 .github/scripts/build-prod.sh rename .github/scripts/{setup-certs.command => setup-certs.sh} (100%) create mode 100644 .github/workflows/release-dev.yml create mode 100644 .github/workflows/release-prod.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/scripts/build-dev.sh b/.github/scripts/build-dev.sh new file mode 100755 index 000000000..016fa33a0 --- /dev/null +++ b/.github/scripts/build-dev.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +BUILD_NAME=$1 +BUILD_NUMBER=$2 + +flutter build ios --flavor development --release --no-codesign --build-name $BUILD_NAME --build-number $BUILD_NUMBER --target lib/main_development.dart +xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development +xcodebuild -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development DEVELOPMENT_TEAM=Y5U9T77F2K -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE_SPECIFIER="development" clean archive CODE_SIGN_IDENTITY="iPhone Developer" +xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/exportOptions.dev.plist \ No newline at end of file diff --git a/.github/scripts/build-prod.sh b/.github/scripts/build-prod.sh new file mode 100755 index 000000000..db111ed99 --- /dev/null +++ b/.github/scripts/build-prod.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +BUILD_NAME=$1 +BUILD_NUMBER=$2 + +sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart +flutter build ios --flavor production --release --no-codesign --build-name $BUILD_NAME --build-number $BUILD_NUMBER --target lib/main_production.dart +xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme production -configuration Release-production +xcodebuild -workspace ios/Runner.xcworkspace -scheme production -configuration Release-production DEVELOPMENT_TEAM=Y5U9T77F2K -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE_SPECIFIER="githubactions-prod" clean archive CODE_SIGN_IDENTITY="Apple Distribution" +xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/exportOptions.prod.plist diff --git a/.github/scripts/setup-certs.command b/.github/scripts/setup-certs.sh similarity index 100% rename from .github/scripts/setup-certs.command rename to .github/scripts/setup-certs.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d9ecdb3c..eedb9f29c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build and test on: pull_request: - branches: [develop, production] + branches: [ main ] workflow_dispatch: @@ -11,14 +11,21 @@ on: storeArtifacts: type: boolean required: false - outputs: - version_tag: - description: "Version used for Git tag" - value: ${{ jobs.version.outputs.version_tag }} + default: false + prodRelease: + type: boolean + required: false + default: false + tagName: + type: string + required: false env: FLUTTER_VERSION: 3.13.1 JAVA_VERSION: 11.x + DEV_RELEASE: ${{ inputs.prodRelease != 'true' || 'false' }} + PROD_RELEASE: ${{ inputs.prodRelease || 'false' }} + TAG_NAME: ${{ inputs.tagName || 'dev' }} jobs: version: @@ -26,21 +33,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Determine versioning - uses: paulhatch/semantic-version@v4.0.3 - id: versioning - with: - tag_prefix: "v" - major_pattern: "(MAJOR)" - minor_pattern: "(MINOR)" - format: "${major}.${minor}.${patch}" - bump_each_commit: false - - name: Determine build version id: build_version run: | @@ -50,16 +42,13 @@ jobs: - name: Print versioning run: | echo "Version: $VERSION" - echo "Version Tag: $VERSION_TAG" echo "Run No: $BUILD_NO" env: - VERSION: ${{ steps.versioning.outputs.version }} - VERSION_TAG: ${{ steps.versioning.outputs.version_tag }} + VERSION: ${{ env.TAG_NAME }} BUILD_NO: ${{ steps.build_version.outputs.build_no }} outputs: - version: ${{ steps.versioning.outputs.version }} - version_tag: ${{ steps.versioning.outputs.version_tag }} + version: ${{ env.TAG_NAME }} build_version: ${{ steps.build_version.outputs.build_no }} build_ios: @@ -72,8 +61,8 @@ jobs: uses: actions/checkout@v2 - name: Install Apple certificate and provisioning profile (dev) - if: github.ref_name != 'production' - run: .github/scripts/setup-certs.command + if: env.DEV_RELEASE == 'true' + run: .github/scripts/setup-certs.sh env: APPLE_IOS_SIGNING_CERT: ${{ secrets.APPLE_IOS_SIGNING_CERTIFICATE_DEVELOPMENT }} APPLE_IOS_SIGNING_CERT_PW: ${{ secrets.APPLE_IOS_SIGNING_CERTIFICATE_DEVELOPMENT_PASSWORD }} @@ -81,8 +70,8 @@ jobs: APPLE_KEYCHAIN_PW: ${{ secrets.APPLE_KEYCHAIN_PW }} - name: Install Apple certificate and provisioning profile (prod) - if: github.ref_name == 'production' - run: .github/scripts/setup-certs.command + if: env.PROD_RELEASE== 'true' + run: .github/scripts/setup-certs.sh env: APPLE_IOS_SIGNING_CERT: ${{ secrets.APPLE_IOS_SIGNING_CERT_PROD }} APPLE_IOS_SIGNING_CERT_PW: ${{ secrets.APPLE_IOS_SIGNING_CERT_PW }} @@ -90,13 +79,13 @@ jobs: APPLE_KEYCHAIN_PW: ${{ secrets.APPLE_KEYCHAIN_PW }} - name: Setup Java - uses: actions/setup-java@v2.4.0 + uses: actions/setup-java@v2 with: distribution: "adopt" java-version: ${{ env.JAVA_VERSION }} - name: Setup Flutter environment - uses: subosito/flutter-action@v2.3.0 + uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} channel: "stable" @@ -104,44 +93,20 @@ jobs: - name: Download dependencies run: flutter pub get - - name: Set URI (prod) - if: github.ref_name == 'production' - run: sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart - - name: Generate code run: dart run build_runner build - - name: Build iOS (dev) - if: github.ref_name != 'production' - run: flutter build ios --flavor development --release --no-codesign --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_development.dart - - name: Build iOS (prod) - if: github.ref_name == 'production' - run: flutter build ios --flavor production --release --no-codesign --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_production.dart - - name: Build resolve Swift dependencies (dev) - if: github.ref_name != 'production' - run: xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development - - name: Build resolve Swift dependencies (prod) - run: xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme production -configuration Release-production - if: github.ref_name == 'production' - - name: Build xArchive (dev) - if: github.ref_name != 'production' - run: | - xcodebuild -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development DEVELOPMENT_TEAM=Y5U9T77F2K -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE_SPECIFIER="development" clean archive CODE_SIGN_IDENTITY="iPhone Developer" - - name: Build xArchive (prod) - if: github.ref_name == 'production' - run: | - xcodebuild -workspace ios/Runner.xcworkspace -scheme production -configuration Release-production DEVELOPMENT_TEAM=Y5U9T77F2K -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE_SPECIFIER="githubactions-prod" clean archive CODE_SIGN_IDENTITY="Apple Distribution" - - name: Export ipa (dev) - if: github.ref_name != 'production' - run: xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/exportOptions.dev.plist + - name: Create Development build + if: env.DEV_RELEASE == 'true' + run: .github/scripts/build-dev.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }} - - name: Export ipa (prod) - if: github.ref_name == 'production' - run: xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/exportOptions.prod.plist + - name: Create Production build + if: env.PROD_RELEASE == 'true' + run: .github/scripts/build-prod.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }} - name: Upload iOS build if: ${{ inputs.storeArtifacts }} - uses: actions/upload-artifact@v3.0.0 + uses: actions/upload-artifact@v3 with: name: ios path: build-output/ios @@ -157,13 +122,13 @@ jobs: uses: actions/checkout@v2 - name: Setup Java - uses: actions/setup-java@v2.4.0 + uses: actions/setup-java@v2 with: distribution: "adopt" java-version: ${{ env.JAVA_VERSION }} - name: Setup Flutter environment - uses: subosito/flutter-action@v2.3.0 + uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} channel: "stable" @@ -172,21 +137,23 @@ jobs: run: flutter pub get - name: Set URI (prod) - if: github.ref_name == 'production' + if: env.PROD_RELEASE == 'true' run: sed -i 's/.env.develop/.env.production/' lib/env/env.dart - name: Generate code run: dart run build_runner build - name: Build appbundle (dev) - if: github.ref_name != 'production' + if: env.DEV_RELEASE == 'true' run: flutter build apk --flavor development --release --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_development.dart + - name: Build appbundle (prod) - if: github.ref_name == 'production' + if: env.PROD_RELEASE== 'true' run: flutter build apk --flavor production --release --dart-define=IS_PROD=true --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_production.dart + - name: Upload Android build if: ${{ inputs.storeArtifacts }} - uses: actions/upload-artifact@v3.0.0 + uses: actions/upload-artifact@v3 with: name: android path: build/app/outputs/flutter-apk diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml index 008661e2d..806d41d12 100644 --- a/.github/workflows/codesee-arch-diagram.yml +++ b/.github/workflows/codesee-arch-diagram.yml @@ -3,7 +3,7 @@ on: push: branches: - - develop + - main pull_request_target: types: [opened, synchronize, reopened] diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml new file mode 100644 index 000000000..6639b80d8 --- /dev/null +++ b/.github/workflows/release-dev.yml @@ -0,0 +1,53 @@ +name: Publish Development App + +on: + push: + branches: [ main ] + +jobs: + build_and_test: + uses: ./.github/workflows/build.yml + with: + storeArtifacts: true + prodRelease: false + secrets: inherit + + dev_upload_ios: + name: Upload iOS build to Firebase App Distribution + runs-on: ubuntu-latest + needs: [build_and_test] + + steps: + - name: Download Artifact + uses: actions/download-artifact@v3.0.0 + with: + name: ios + - name: Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 + with: + appId: ${{ secrets.FIREBASE_IOS_APP_ID }} + token: ${{ secrets.FIREBASE_TOKEN }} + # FIXME: token is deprecated, use serviceCredentialsFileContent instead + # serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: analogio-devs + file: Analog.ipa + + dev_upload_android: + name: Upload Android build to Firebase App Distribution + runs-on: ubuntu-latest + needs: [build_and_test] + + steps: + - name: Download artifact + uses: actions/download-artifact@v3.0.0 + with: + name: android + - name: Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 + with: + appId: ${{ secrets.FIREBASE_ANDROID_APP_ID }} + token: ${{ secrets.FIREBASE_TOKEN }} + # FIXME: token is deprecated, use serviceCredentialsFileContent instead + # serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: analogio-devs + file: app-development-release.apk diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml new file mode 100644 index 000000000..1dce3f16b --- /dev/null +++ b/.github/workflows/release-prod.yml @@ -0,0 +1,59 @@ +name: Release Production App + +on: + release: + types: [created] + +jobs: + build_and_test: + uses: ./.github/workflows/build.yml + with: + storeArtifacts: true + prodRelease: true + tagName: ${{ github.event.inputs.tagName }} + secrets: inherit + + prod_release_ios: + name: Upload iOS build to App Store connect + runs-on: macos-latest + needs: [build_and_test] + + steps: + - name: Download artifact + uses: actions/download-artifact@v3.0.0 + with: + name: ios + - name: Upload app to App Store Connect + env: + APP_STORE_CONNECT_USERNAME: ${{ secrets.APP_STORE_CONNECT_USERNAME }} + APP_STORE_CONNECT_PASSWORD: ${{ secrets.APP_STORE_CONNECT_PASSWORD }} + run: | + xcrun altool --upload-app -t ios -f "Analog.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD" + + prod_release_android: + name: Upload Android build to Play Store + runs-on: ubuntu-latest + needs: [build_and_test] + + steps: + - name: Download artifact + uses: actions/download-artifact@v3.0.0 + with: + name: android + - name: Sign Android appbundle + uses: r0adkll/sign-android-release@v1 + id: sign_app + with: + releaseDirectory: . + signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} + alias: ${{ secrets.ANDROID_KEY_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} + - name: Upload to Google Play Store + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT_JSON }} + packageName: dk.analog.digitalclipcard + releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }} + track: internal + status: draft diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9255b7d52..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Release Coffeecard App - -on: - push: - branches: [develop, production] - paths: - - android/** - - assets/** - - ios/** - - lib/** - - openapi/** - - .metadata - - .github/workflows/** - - pubspec.lock - - pubspec.yml - - .env.develop - - .env.production - -jobs: - build_and_test: - uses: ./.github/workflows/build.yml - with: - storeArtifacts: true - secrets: inherit - - dev_upload_ios: - name: Upload iOS build to Firebase App Distribution - runs-on: ubuntu-latest - needs: [build_and_test] - if: github.ref_name == 'develop' - - steps: - - name: Download Artifact - uses: actions/download-artifact@v3.0.0 - with: - name: ios - - name: Firebase App Distribution - uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 - with: - appId: ${{ secrets.FIREBASE_IOS_APP_ID }} - token: ${{ secrets.FIREBASE_TOKEN }} - groups: analogio-devs - file: Analog.ipa - - dev_upload_android: - name: Upload Android build to Firebase App Distribution - runs-on: ubuntu-latest - needs: [build_and_test] - if: github.ref_name == 'develop' - - steps: - - name: Download artifact - uses: actions/download-artifact@v3.0.0 - with: - name: android - - name: Firebase App Distribution - uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 - with: - appId: ${{ secrets.FIREBASE_ANDROID_APP_ID }} - token: ${{ secrets.FIREBASE_TOKEN }} - groups: analogio-devs - file: app-development-release.apk - - prod_release_ios: - name: Upload iOS build to App Store connect - runs-on: macos-latest - needs: [build_and_test] - if: github.ref_name == 'production' - - steps: - - name: Download artifact - uses: actions/download-artifact@v3.0.0 - with: - name: ios - - name: Upload app to App Store Connect - env: - APP_STORE_CONNECT_USERNAME: ${{ secrets.APP_STORE_CONNECT_USERNAME }} - APP_STORE_CONNECT_PASSWORD: ${{ secrets.APP_STORE_CONNECT_PASSWORD }} - run: | - xcrun altool --upload-app -t ios -f "Analog.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD" - - prod_release_android: - name: Upload Android build to Play Store - runs-on: ubuntu-latest - needs: [build_and_test] - if: github.ref_name == 'production' - - steps: - - name: Download artifact - uses: actions/download-artifact@v3.0.0 - with: - name: android - - name: Sign Android appbundle - uses: r0adkll/sign-android-release@v1 - id: sign_app - with: - releaseDirectory: . - signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} - alias: ${{ secrets.ANDROID_KEY_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} - - name: Upload to Google Play Store - uses: r0adkll/upload-google-play@v1.0.16 - with: - serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT_JSON }} - packageName: dk.analog.digitalclipcard - releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }} - track: internal - status: draft - - tag: - name: Git Tag version - runs-on: ubuntu-latest - needs: [build_and_test, prod_release_ios, prod_release_android] - if: ${{ needs.prod_release_ios.result == 'success' && needs.prod_release_android.result == 'success' }} - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Git Tag ${{ needs.build_and_test.outputs.version_tag }} - uses: anothrNick/github-tag-action@1.36.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CUSTOM_TAG: ${{ needs.build_and_test.outputs.version_tag }} From a52acdb687117e01f3f1f57f3f7d996e3cce929a Mon Sep 17 00:00:00 2001 From: Jonas Anker Rasmussen Date: Sat, 14 Oct 2023 23:40:39 +0200 Subject: [PATCH 2/3] Update ref to release name (#519) --- .github/workflows/build.yml | 8 +++----- .github/workflows/release-dev.yml | 2 ++ .github/workflows/release-prod.yml | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eedb9f29c..1d7789b6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,6 @@ on: prodRelease: type: boolean required: false - default: false tagName: type: string required: false @@ -23,7 +22,6 @@ on: env: FLUTTER_VERSION: 3.13.1 JAVA_VERSION: 11.x - DEV_RELEASE: ${{ inputs.prodRelease != 'true' || 'false' }} PROD_RELEASE: ${{ inputs.prodRelease || 'false' }} TAG_NAME: ${{ inputs.tagName || 'dev' }} @@ -61,7 +59,7 @@ jobs: uses: actions/checkout@v2 - name: Install Apple certificate and provisioning profile (dev) - if: env.DEV_RELEASE == 'true' + if: env.PROD_RELEASE != 'true' run: .github/scripts/setup-certs.sh env: APPLE_IOS_SIGNING_CERT: ${{ secrets.APPLE_IOS_SIGNING_CERTIFICATE_DEVELOPMENT }} @@ -97,7 +95,7 @@ jobs: run: dart run build_runner build - name: Create Development build - if: env.DEV_RELEASE == 'true' + if: env.PROD_RELEASE != 'true' run: .github/scripts/build-dev.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }} - name: Create Production build @@ -144,7 +142,7 @@ jobs: run: dart run build_runner build - name: Build appbundle (dev) - if: env.DEV_RELEASE == 'true' + if: env.PROD_RELEASE != 'true' run: flutter build apk --flavor development --release --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_development.dart - name: Build appbundle (prod) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 6639b80d8..c1e7db0ff 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -22,6 +22,7 @@ jobs: uses: actions/download-artifact@v3.0.0 with: name: ios + - name: Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 with: @@ -42,6 +43,7 @@ jobs: uses: actions/download-artifact@v3.0.0 with: name: android + - name: Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 with: diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 1dce3f16b..775bd25d3 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -10,7 +10,7 @@ jobs: with: storeArtifacts: true prodRelease: true - tagName: ${{ github.event.inputs.tagName }} + tagName: ${{ github.event.release.tag_name }} secrets: inherit prod_release_ios: @@ -23,6 +23,7 @@ jobs: uses: actions/download-artifact@v3.0.0 with: name: ios + - name: Upload app to App Store Connect env: APP_STORE_CONNECT_USERNAME: ${{ secrets.APP_STORE_CONNECT_USERNAME }} @@ -40,6 +41,7 @@ jobs: uses: actions/download-artifact@v3.0.0 with: name: android + - name: Sign Android appbundle uses: r0adkll/sign-android-release@v1 id: sign_app @@ -49,6 +51,7 @@ jobs: alias: ${{ secrets.ANDROID_KEY_ALIAS }} keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} + - name: Upload to Google Play Store uses: r0adkll/upload-google-play@v1 with: From 041b53db2d7d3331b48b9eec5e4a2db8a9666092 Mon Sep 17 00:00:00 2001 From: Omid Marfavi <21163286+marfavi@users.noreply.github.com> Date: Sun, 15 Oct 2023 01:01:45 +0200 Subject: [PATCH 3/3] Fix email validation logic in Forgot Passcode page (#521) Inverted an if-else that would determine whether to show the "no account exists" error or not. --- .../presentation/widgets/forgot_passcode_form.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/features/login/presentation/widgets/forgot_passcode_form.dart b/lib/features/login/presentation/widgets/forgot_passcode_form.dart index 0da3c35a5..fc1d54555 100644 --- a/lib/features/login/presentation/widgets/forgot_passcode_form.dart +++ b/lib/features/login/presentation/widgets/forgot_passcode_form.dart @@ -28,14 +28,14 @@ class ForgotPasscodeForm extends StatelessWidget { InputValidator( forceErrorMessage: true, validate: (text) async { - final either = + final emailExistsResult = await sl().emailExists(text); - return either.fold( - (l) => const Left(Strings.emailValidationError), - (r) => r - ? const Left(Strings.forgotPasscodeNoAccountExists) - : const Right(null), + return emailExistsResult.fold( + (error) => const Left(Strings.emailValidationError), + (emailExists) => emailExists + ? const Right(null) + : const Left(Strings.forgotPasscodeNoAccountExists), ); }, ),