From 1f4b3149639e02b46fddc7a5117054cd917a835e Mon Sep 17 00:00:00 2001 From: Long Vu Date: Tue, 23 Apr 2024 09:39:29 +0700 Subject: [PATCH] Update iOS --- .github/workflows/auto_test_android.yaml | 7 +++-- .github/workflows/auto_test_ios.yaml | 33 +++++++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto_test_android.yaml b/.github/workflows/auto_test_android.yaml index 1583f7b88..69b004c9a 100644 --- a/.github/workflows/auto_test_android.yaml +++ b/.github/workflows/auto_test_android.yaml @@ -13,9 +13,12 @@ jobs: # Checkout code and get packages. - name: Checkout code uses: actions/checkout@v3 - - uses: webfactory/ssh-agent@v0.5.4 + - name: SSH key + uses: webfactory/ssh-agent@v0.5.4 with: - ssh-private-key: ${{ secrets.SSH_ASSETS_KEY }} + ssh-private-key: | + ${{ secrets.KEY_VAULT_DEPLOYMENT_KEY }} + ${{ secrets.SSH_ASSETS_KEY }} # Set build number - name: Set env run: | diff --git a/.github/workflows/auto_test_ios.yaml b/.github/workflows/auto_test_ios.yaml index cb8d9fb08..ee524d4c2 100644 --- a/.github/workflows/auto_test_ios.yaml +++ b/.github/workflows/auto_test_ios.yaml @@ -20,15 +20,20 @@ jobs: echo "FLUTTER_VERSION_CODE=10" >> $GITHUB_ENV echo "BRANCH_KEY=${{ secrets.BRANCH_KEY }}" >> $GITHUB_ENV echo "BRANCH_KEY_TEST=${{ secrets.BRANCH_KEY_TEST }}" >> $GITHUB_ENV - - uses: webfactory/ssh-agent@v0.5.4 + - name: SSH key + uses: webfactory/ssh-agent@v0.5.4 with: - ssh-private-key: ${{ secrets.SSH_ASSETS_KEY }} + ssh-private-key: | + ${{ secrets.KEY_VAULT_DEPLOYMENT_KEY }} + ${{ secrets.SSH_ASSETS_KEY }} - name: Create env file run: | touch .env echo AUTO_TEST_PLATFORM=ios >> .env echo AUTO_TEST_PROFILE=XsmaxBitmark >> .env + echo FASTLAN_ENV=test >> $GITHUB_ENV + echo AUTOTEST_ENV= "${{ secrets.AUTOTEST_ENV }}" | sed 's/\\n/\n/g' >> .env cat .env @@ -37,8 +42,28 @@ jobs: - run: flutter pub cache repair - run: flutter pub get # Build app - - name: Build to IPA inhouse app - run: flutter build ipa --flavor inhouse --export-options-plist ios/ExportOptions-Inhouse.plist + - name: Build and deploy with Fastlane + env: + ENTERPRISE_CERTIFICATE_PASSWORD: ${{ secrets.ENTERPRISE_CERTIFICATE_PASSWORD }} + APPSTORE_CERTIFICATE_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATE_PASSWORD }} + JSON_FILE: ${{ secrets.JSON_FILE }} + SENTRY_AUTH: ${{ secrets.SENTRY_AUTH }} + APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }} + APP_VERSION: ${{ inputs.version }} + BRANCH_KEY: ${{ secrets.BRANCH_KEY }} + RELEASE_NOTES: ${{ inputs.message }} + + run: | + git clone git@github.com:bitmark-inc/mobile-signing-key-vault.git --depth 1 + echo $JSON_FILE >> key.json + bundle exec fastlane install_plugins + echo "APP_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + bundle exec fastlane ciappcenter env:${{ env.FASTLAN_ENV }} + + working-directory: ios + + # - name: Build to IPA inhouse app + # run: flutter build ipa --flavor inhouse --export-options-plist ios/ExportOptions-Inhouse.plist - name: CD to auto-test folder run: | cd auto-test