diff --git a/.github/actions/build_android/action.yml b/.github/actions/build_android/action.yml index e6efe1329..2c2354291 100644 --- a/.github/actions/build_android/action.yml +++ b/.github/actions/build_android/action.yml @@ -31,16 +31,16 @@ runs: - name: Build apk (dev) if: ${{ inputs.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 + run: flutter build apk --flavor development --release --build-name ${{ inputs.version }} --build-number ${{ inputs.build_version }} --target lib/main_development.dart shell: bash - name: Build appbundle (prod) if: ${{ inputs.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 + run: flutter build apk --flavor production --release --dart-define=IS_PROD=true --build-name ${{ inputs.version }} --build-number ${{ inputs.build_version }} --target lib/main_production.dart shell: bash - name: Upload Android build (dev) - if: ${{ !!inputs.store_artifacts && ${{ inputs.prod_release }} != 'true' }} + if: ${{ !!inputs.store_artifacts && inputs.prod_release != 'true' }} uses: actions/upload-artifact@v3.0.0 with: name: android @@ -49,7 +49,7 @@ runs: if-no-files-found: error - name: Upload Android build (prod) - if: ${{ !!inputs.store_artifacts && ${{ inputs.prod_release }} == 'true' }} + if: ${{ !!inputs.store_artifacts && inputs.prod_release == 'true' }} uses: actions/upload-artifact@v3.0.0 with: name: android diff --git a/.github/actions/build_ios/action.yml b/.github/actions/build_ios/action.yml index ef0106395..6cc069691 100644 --- a/.github/actions/build_ios/action.yml +++ b/.github/actions/build_ios/action.yml @@ -40,7 +40,7 @@ runs: steps: - name: Install Apple certificate and provisioning profile (dev) if: ${{ inputs.prod_release }} != 'true' - run: .github/scripts/setup-certs.command + run: .github/scripts/setup-certs.sh env: APPLE_IOS_SIGNING_CERT: ${{ inputs.apple_ios_signing_cert_dev }} APPLE_IOS_SIGNING_CERT_PW: ${{ inputs.apple_ios_signing_cert_pw_dev }} @@ -49,8 +49,8 @@ runs: shell: bash - name: Install Apple certificate and provisioning profile (prod) - if: ${{ inputs.prod_release }}== 'true' - run: .github/scripts/setup-certs.command + if: ${{ inputs.prod_release }} == 'true' + run: .github/scripts/setup-certs.sh env: APPLE_IOS_SIGNING_CERT: ${{ inputs.apple_ios_signing_cert_prod }} APPLE_IOS_SIGNING_CERT_PW: ${{ inputs.apple_ios_signing_cert_pw_prod }} @@ -58,12 +58,9 @@ runs: APPLE_KEYCHAIN_PW: ${{ inputs.apple_keychain_pw }} shell: bash - - name: Setup Flutter environment - uses: ./.github/actions/setup_flutter_environment - - - name: Set URI (prod) - if: github.ref_name == 'production' - run: sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart + - name: Replace target URI in Production + if: ${{ inputs.prod_release }} == 'true' + run: sed -i 's/.env.develop/.env.production/' lib/env/env.dart shell: bash - name: Generate code @@ -72,12 +69,12 @@ runs: - name: Build iOS (dev) if: ${{ inputs.prod_release }} != 'true' - run: .github/scripts/build-dev.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }} + run: .github/scripts/build-dev.sh ${{ inputs.version }} ${{ inputs.build_version }} shell: bash - name: Build iOS (prod) if: ${{ inputs.prod_release }} == 'true' - run: .github/scripts/build-prod.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }} + run: .github/scripts/build-prod.sh ${{ inputs.version }} ${{ inputs.build_version }} shell: bash - name: Upload iOS build diff --git a/.github/actions/setup_flutter_environment/action.yml b/.github/actions/setup_flutter_environment/action.yml index 5170e8083..0b528e8e2 100644 --- a/.github/actions/setup_flutter_environment/action.yml +++ b/.github/actions/setup_flutter_environment/action.yml @@ -1,5 +1,10 @@ name: Setup Flutter environment description: Setup the Flutter environment +inputs: + prod_release: + required: false + default: 'false' + description: "Is prod release" env: FLUTTER_VERSION: 3.13.7 @@ -7,12 +12,12 @@ env: runs: using: "composite" steps: - - name: Setup Flutter environment - uses: subosito/flutter-action@v2.8.0 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: "stable" + - name: Setup Flutter environment + uses: subosito/flutter-action@v2.8.0 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: "stable" - - name: Download dependencies - run: flutter pub get - shell: bash \ No newline at end of file + - name: Download dependencies + run: flutter pub get + shell: bash \ No newline at end of file diff --git a/.github/actions/upload_android/action.yml b/.github/actions/upload_android/action.yml deleted file mode 100644 index c1b9656d4..000000000 --- a/.github/actions/upload_android/action.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Upload Android app -description: Upload Android app -inputs: - firebase_android_app_id: - required: true - description: "Firebase Android app id" - firebase_token: - required: true - description: "Firebase token" - android_signing_key: - required: true - description: "Android signing key" - android_key_alias: - required: true - description: "Android key alias" - android_keystore_password: - required: true - description: "Android keystore password" - android_Key_password: - required: true - description: "Android key password" - playstore_service_account: - required: true - description: "Playstore service account json" - -runs: - using: "composite" - steps: - - name: Download artifact - uses: actions/download-artifact@v3.0.0 - with: - name: android - - - name: Firebase App Distribution - uses: ./.github/actions/upload_to_firebase - with: - firebase_app_id: ${{ inputs.firebase_android_app_id }} - firebase_token: ${{ inputs.firebase_token }} - file: app-development-release.apk - if: github.ref_name != 'production' - - - name: Sign Android appbundle - uses: r0adkll/sign-android-release@v1 - id: sign_app - with: - releaseDirectory: . - signingKeyBase64: ${{ inputs.android_signing_key }} - alias: ${{ inputs.android_key_alias }} - keyStorePassword: ${{ inputs.android_keystore_password }} - keyPassword: ${{ inputs.android_key_password }} - if: github.ref_name == 'production' - - - name: Upload to Google Play Store - uses: r0adkll/upload-google-play@v1.0.16 - with: - serviceAccountJsonPlainText: ${{ inputs.playstore_service_account }} - packageName: dk.analog.digitalclipcard - releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }} - track: internal - status: draft - if: github.ref_name == 'production' diff --git a/.github/actions/upload_ios/action.yml b/.github/actions/upload_ios/action.yml deleted file mode 100644 index 84ee71e85..000000000 --- a/.github/actions/upload_ios/action.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Upload iOS app -description: Upload iOS app -inputs: - app_store_connect_username: - required: true - description: "App Store Connect username" - app_store_connect_password: - required: true - description: "App Store Connect password" - firebase_ios_app_id: - required: true - description: "Firebase iOS app id" - firebase_token: - required: true - description: "Firebase token" - -runs: - using: "composite" - steps: - - name: Download artifact - uses: actions/download-artifact@v3.0.0 - with: - name: ios - - - name: Upload to Firebase App Distribution - uses: ./.github/actions/upload_to_firebase - with: - firebase_app_id: ${{ inputs.firebase_ios_app_id }} - firebase_token: ${{ inputs.firebase_token }} - file: Analog.ipa - if: github.ref_name != 'production' - - - name: Upload to App Store Connect - env: - APP_STORE_CONNECT_USERNAME: ${{ inputs.app_store_connect_username }} - APP_STORE_CONNECT_PASSWORD: ${{ inputs.app_store_connect_password }} - run: | - xcrun altool --upload-app -t ios -f "Analog.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD" - shell: bash - if: github.ref_name == 'production' \ No newline at end of file diff --git a/.github/actions/upload_to_firebase/action.yml b/.github/actions/upload_to_firebase/action.yml deleted file mode 100644 index 84ac6ee54..000000000 --- a/.github/actions/upload_to_firebase/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Upload to Firebase -description: Upload a file to Firebase App Distribution -inputs: - firebase_app_id: - required: true - description: "Firebase app id" - firebase_token: - required: true - description: "Firebase token" - file: - required: true - description: "File to upload" - -runs: - using: "composite" - steps: - - name: Upload to Firebase App Distribution - uses: wzieba/Firebase-Distribution-Github-Action@v1.3.3 - with: - appId: ${{ inputs.firebase_ios_app_id }} - token: ${{ inputs.firebase_token }} - groups: analogio-devs - file: ${{ inputs.file }} \ No newline at end of file diff --git a/.github/workflows/codesee.yml b/.github/workflows/codesee.yml index 78fff88e5..5e38b969b 100644 --- a/.github/workflows/codesee.yml +++ b/.github/workflows/codesee.yml @@ -2,8 +2,7 @@ # This is v2.0 of this workflow file on: push: - branches: - - main + branches: [ main ] pull_request_target: types: [opened, synchronize, reopened] diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index a3e3b1a5a..359cd2a5d 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -5,17 +5,17 @@ on: branches: [ main ] jobs: - build_and_test: + build: uses: ./.github/workflows/build.yml with: store_artifacts: true prod_release: false secrets: inherit - dev_upload_ios: + upload_ios: name: Upload iOS build to Firebase App Distribution runs-on: ubuntu-latest - needs: [build_and_test] + needs: [build] steps: - name: Download Artifact @@ -33,10 +33,10 @@ jobs: groups: analogio-devs file: Analog.ipa - dev_upload_android: + upload_android: name: Upload Android build to Firebase App Distribution runs-on: ubuntu-latest - needs: [build_and_test] + needs: [build] steps: - name: Download artifact diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index e913699b9..e8fd4254f 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -2,21 +2,21 @@ name: Release Production App on: release: - types: [created] + types: [ created ] jobs: - build_and_test: + build: uses: ./.github/workflows/build.yml with: store_artifacts: true prod_release: true - tagName: ${{ github.event.release.tag_name }} + tag_name: ${{ github.event.release.tag_name }} secrets: inherit - prod_release_ios: + release_ios: name: Upload iOS build to App Store connect runs-on: macos-latest - needs: [build_and_test] + needs: [build] steps: - name: Download artifact @@ -31,10 +31,10 @@ jobs: run: | xcrun altool --upload-app -t ios -f "Analog.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD" - prod_release_android: + release_android: name: Upload Android build to Play Store runs-on: ubuntu-latest - needs: [build_and_test] + needs: [build] steps: - name: Download artifact diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e352aef3..39f082362 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Test on: pull_request: - branches: [production, develop] + branches: [main] jobs: build-and-test: @@ -10,14 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Setup Flutter environment uses: ./.github/actions/setup_flutter_environment - - name: Generate code - run: dart run build_runner build - - name: Check formatting run: dart format --set-exit-if-changed lib/