From eb0dcf2f19b36f7774e16969945af967c8c834d3 Mon Sep 17 00:00:00 2001 From: Steve Cassidy Date: Thu, 28 Nov 2024 11:10:23 +1100 Subject: [PATCH 1/3] remove mention of VITE_PROD* variables that aren't used Signed-off-by: Steve Cassidy --- .github/workflows/nightly-android-testbuild.yml | 2 -- app/.env.dist | 2 -- app/.github/workflows/appstore-deploy.yml | 4 +--- app/.github/workflows/appstore-testflight.yml | 4 +--- infrastructure/aws-cdk/lib/components/front-end.ts | 1 - 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/nightly-android-testbuild.yml b/.github/workflows/nightly-android-testbuild.yml index fefa5d66c..f8e5842f6 100644 --- a/.github/workflows/nightly-android-testbuild.yml +++ b/.github/workflows/nightly-android-testbuild.yml @@ -124,8 +124,6 @@ jobs: export VITE_SHOW_WIPE=true export VITE_SHOW_MINIFAUXTON=true export VITE_CONDUCTOR_URL=${{vars.NIGHTLY_CONDUCTOR_URL}} - export VITE_PRODUCTION_BUILD=true - export VITE_PROD_BUILD=true export VITE_TAG=prodAndroid export VITE_NOTEBOOK_LIST_TYPE=${{vars.NOTEBOOK_LIST_TYPE}} export VITE_NOTEBOOK_NAME=${{vars.NOTEBOOK_NAME}} diff --git a/app/.env.dist b/app/.env.dist index bfab4545f..4dc2356d5 100644 --- a/app/.env.dist +++ b/app/.env.dist @@ -11,8 +11,6 @@ VITE_POUCH_BATCH_SIZE=1000 VITE_BUGSNAG_KEY= # Set to true to enable some debugging messaging VITE_DEBUG_APP=true -# Set to true for a production build with VITE -VITE_PRODUCTION_BUILD=false # Set to true for verbose debug messages from PouchDB VITE_POUCHDB_DEBUG=false # The theme to use for the app, 'default' or 'bubble' or 'bssTheme' diff --git a/app/.github/workflows/appstore-deploy.yml b/app/.github/workflows/appstore-deploy.yml index 2d7ed7f6c..2cd193099 100644 --- a/app/.github/workflows/appstore-deploy.yml +++ b/app/.github/workflows/appstore-deploy.yml @@ -55,9 +55,7 @@ jobs: export VITE_SHOW_WIPE=true export VITE_SHOW_MINIFAUXTON=false export VITE_DIRECTORY_HOST=db.fieldmark.app - export VITE_DIRECTORY_PORT=443 - export VITE_PRODUCTION_BUILD=true - export VITE_PROD_BUILD=true + export VITE_DIRECTORY_PORT=443 export VITE_TAG=prodIOS export VITE_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} git clean -xfd diff --git a/app/.github/workflows/appstore-testflight.yml b/app/.github/workflows/appstore-testflight.yml index a1a01ca6e..4b2d76c7d 100644 --- a/app/.github/workflows/appstore-testflight.yml +++ b/app/.github/workflows/appstore-testflight.yml @@ -68,9 +68,7 @@ jobs: export VITE_SHOW_WIPE=true export VITE_SHOW_MINIFAUXTON=false export VITE_DIRECTORY_HOST=db.testing.fieldmark.app - export VITE_DIRECTORY_PORT=443 - export VITE_PRODUCTION_BUILD=true - export VITE_PROD_BUILD=true + export VITE_DIRECTORY_PORT=443 export VITE_TAG=prodIOS export VITE_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} git clean -xfd diff --git a/infrastructure/aws-cdk/lib/components/front-end.ts b/infrastructure/aws-cdk/lib/components/front-end.ts index 80c40d45e..9b600adee 100644 --- a/infrastructure/aws-cdk/lib/components/front-end.ts +++ b/infrastructure/aws-cdk/lib/components/front-end.ts @@ -159,7 +159,6 @@ export class FaimsFrontEnd extends Construct { VITE_SHOW_RECORD_SUMMARY_COUNTS: 'true', // Conductor API URL VITE_CONDUCTOR_URL: props.conductorUrl, - VITE_PRODUCTION_BUILD: 'true', VITE_TAG: 'CDKDeployment', }; From fc4e4b3dc1e74bddddbb5cc1975212675a24ff48 Mon Sep 17 00:00:00 2001 From: Steve Cassidy Date: Thu, 28 Nov 2024 11:10:47 +1100 Subject: [PATCH 2/3] update production deploy to match nightly Signed-off-by: Steve Cassidy --- .../workflows/fieldmark-google-play-prod.yml | 67 ++++++++++--------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/.github/workflows/fieldmark-google-play-prod.yml b/.github/workflows/fieldmark-google-play-prod.yml index ba4cc54c0..65d93b61f 100644 --- a/.github/workflows/fieldmark-google-play-prod.yml +++ b/.github/workflows/fieldmark-google-play-prod.yml @@ -1,5 +1,5 @@ -name: Deploy to Google Play For Prod deploy +name: Deploy to Google Play For Production on: workflow_dispatch: @@ -8,21 +8,20 @@ jobs: node-deb-gh-build-play: runs-on: ubuntu-latest continue-on-error: true + env: + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} strategy: matrix: node-version: ['20'] - outputs: - prnum: ${{ steps.prnum.outputs.value }} - # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | @@ -43,21 +42,32 @@ jobs: else echo "TURBO_TEAM and/or TURBO_TOKEN not set. Remote caching may not be available." fi + - name: Install jq + run: sudo apt-get install -y jq + - name: Declare some variables + shell: bash + run: | + echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" + echo "app_version=$(jq -r '.version' app/package.json)" >> "$GITHUB_ENV" + - name: Create version string + shell: bash + run: | + echo "version_string=v${{env.app_version}}-android-#${{env.sha_short}}" >> "$GITHUB_ENV" # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-gradle - name: Cache Gradle packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-gradle - name: Set up adopt JDK 1.17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: '17' @@ -68,18 +78,7 @@ jobs: with: ruby-version: 3.3.1 bundler-cache: true - working-directory: android - # We'll do this when we have android-specific tests... - # - name: Run tests - # run: | - # cd android - # bundle exec fastlane android test - # echo -n "::set-output name=value::$(git log --perl-regexp --pretty='%s' | grep 'Merge #' | head -n1 | cut -d'#' -f2)-$(git describe --long 2>/dev/null || git describe --all --long --always)" - - name: Get PR Number - id: prnum - run: | - echo -n "value=$(bin/getDescribeString.sh gh-play)" >> "$GITHUB_OUTPUT" - shell: bash + working-directory: android - name: Decode Service Account Key JSON File uses: timheuer/base64-to-file@v1 id: service_account_json_file @@ -94,27 +93,30 @@ jobs: encodedString: ${{ secrets.KEYSTORE_FILE }} # https://github.com/android-actions/setup-android - name: Setup Android SDK - uses: android-actions/setup-android@v2 + uses: android-actions/setup-android@v3 - name: Building webapp run: | export platform="github-actions-play" export serverprefix="fieldmark" export VITE_CLUSTER_ADMIN_GROUP_NAME=cluster-admin - export VITE_COMMIT_VERSION=$(bin/getDescribeString.sh android) + export VITE_COMMIT_VERSION=${{env.version_string}} export VITE_SHOW_WIPE=true export VITE_SHOW_MINIFAUXTON=false - export VITE_DIRECTORY_HOST=${{vars.PRODUCTION_CONDUCTOR_URL}} - export VITE_DIRECTORY_PORT=443 - export VITE_PRODUCTION_BUILD=true - export VITE_PROD_BUILD=true - export VITE_TAG=prodAndroid + export VITE_CONDUCTOR_URL=${{vars.NIGHTLY_CONDUCTOR_URL}} + export VITE_TAG=prodAndroid + export VITE_NOTEBOOK_LIST_TYPE=${{vars.NOTEBOOK_LIST_TYPE}} + export VITE_NOTEBOOK_NAME=${{vars.NOTEBOOK_NAME}} + export VITE_THEME=${{vars.THEME}} export VITE_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} + export VITE_APP_ID=${{vars.APP_ID}} + export VITE_APP_NAME="${{vars.APP_NAME}}" + export VITE_SHOW_RECORD_SUMMARY_COUNTS="${{vars.VITE_SHOW_RECORD_SUMMARY_COUNTS}}" npm ci npm run build # https://capacitorjs.com/docs/android # The bundle install shouldn't be necessary, but given we've got ios and android in... - - run: npx cap update android - - run: npx cap sync --deployment android + - run: npm run app-update android --workspace=@faims3/app + - run: npm run webapp-sync --workspace=@faims3/app -- --deployment android - name: Fastlane run: | cd android @@ -122,6 +124,7 @@ jobs: bundle exec fastlane deploy_fieldmark env: APP_ID: ${{ vars.APP_ID }} + ANDROID_RELEASE_STATUS: ${{ vars.ANDROID_RELEASE_STATUS }} ANDROID_DEPLOY_TRACK: "production" JAVA_KEYSTORE: ${{ steps.android_keystore.outputs.filePath }} JAVA_KEYSTORE_PASSWORD: ${{ secrets.JAVA_KEYSTORE_PASSWORD }} @@ -129,4 +132,4 @@ jobs: JAVA_KEY_PASSWORD: ${{ secrets.JAVA_KEY_PASSWORD }} ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }} serverprefix: "fieldmark" - prnum: ${{steps.prnum.outputs.value}} + prnum: ${{env.version_string}} From 60d0f09c8da88eae994031b383dd6810c19590a9 Mon Sep 17 00:00:00 2001 From: Steve Cassidy Date: Thu, 28 Nov 2024 11:32:08 +1100 Subject: [PATCH 3/3] fix android folder location Signed-off-by: Steve Cassidy --- .github/workflows/fieldmark-google-play-prod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fieldmark-google-play-prod.yml b/.github/workflows/fieldmark-google-play-prod.yml index 65d93b61f..ce2115bdf 100644 --- a/.github/workflows/fieldmark-google-play-prod.yml +++ b/.github/workflows/fieldmark-google-play-prod.yml @@ -78,7 +78,7 @@ jobs: with: ruby-version: 3.3.1 bundler-cache: true - working-directory: android + working-directory: app/android - name: Decode Service Account Key JSON File uses: timheuer/base64-to-file@v1 id: service_account_json_file @@ -119,7 +119,7 @@ jobs: - run: npm run webapp-sync --workspace=@faims3/app -- --deployment android - name: Fastlane run: | - cd android + cd app/android bundle install bundle exec fastlane deploy_fieldmark env: