diff --git a/.github/workflows/appstore-deploy.yml b/.github/workflows/appstore-deploy.yml index 2cd193099..c58d0c76d 100644 --- a/.github/workflows/appstore-deploy.yml +++ b/.github/workflows/appstore-deploy.yml @@ -1,43 +1,53 @@ ---- name: Deploy to Apple App Store Production, Manual on: workflow_dispatch: jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v3 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - ios-deploy: name: Deploying to Production runs-on: macOS-latest - needs: check_date steps: + # note not using Turbo build as it caused a problem with missing assets - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install jq + run: | + brew update + brew install 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}}-ios-#${{env.sha_short}}" >> "$GITHUB_ENV" + - name: Set up ruby env uses: ruby/setup-ruby@v1 with: ruby-version: 3.3.1 - bundler-cache: false - working-directory: ios/App + bundler-cache: true + working-directory: app/ios/App - run: | - cd ios/App; bundle install; bundle exec fastlane install_plugins + cd app/ios/App + bundle install + bundle exec fastlane install_plugins - name: Use Node.js 20 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -49,49 +59,46 @@ jobs: run: | export platform="github-actions-ios" export serverprefix="fieldmark" - export PYTHON=python3.10 export VITE_CLUSTER_ADMIN_GROUP_NAME=cluster-admin - export VITE_COMMIT_VERSION=$(bin/getDescribeString.sh ios) + export VITE_COMMIT_VERSION=${{env.version_string}} export VITE_SHOW_WIPE=true - export VITE_SHOW_MINIFAUXTON=false - export VITE_DIRECTORY_HOST=db.fieldmark.app - export VITE_DIRECTORY_PORT=443 + export VITE_SHOW_MINIFAUXTON=true + export VITE_CONDUCTOR_URL=${{vars.NIGHTLY_CONDUCTOR_URL}} export VITE_TAG=prodIOS - export VITE_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} - git clean -xfd + 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 --python=python3.10 npm run build - - run: npx cap update ios - - run: npx cap sync --deployment ios - - run: cd ios/App; pod install + - name: Update IOS Build + run: | + cd app + npx cap update ios + npx cap sync --deployment ios + cd ios/App; pod install - name: Deploy iOS app to production with Fastlane uses: maierj/fastlane-action@v2.3.0 with: lane: production - subdirectory: 'ios/App' + subdirectory: 'app/ios/App' bundle-install-path: '$HOME/vendor/bundle' verbose: false env: - VITE_LOGIN_TOKEN: "${{ secrets.JWT_TEST_TOKEN }}" APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' - DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}' - DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}' + DEVELOPER_APP_ID: '${{ vars.DEVELOPER_APP_ID }}' + APPLE_BUNDLE_IDENTIFIER: '${{ vars.APPLE_BUNDLE_IDENTIFIER }}' DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}' FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}' FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}' GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}' - TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}' - TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}' APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' BROWSERSTACK_USERNAME: '${{secrets.BROWSERSTACK_USERNAME}}' BROWSERSTACK_ACCESS_KEY: '${{secrets.BROWSERSTACK_ACCESS_KEY}}' - - name: Archive ipas - uses: actions/upload-artifact@v3 - with: - name: ipa - path: | - /Users/runner/work/FAIMS3/FAIMS3/ios/App/App.ipa \ No newline at end of file diff --git a/.github/workflows/appstore-testflight.yml b/.github/workflows/appstore-testflight.yml index 31665167c..5a62fbecc 100644 --- a/.github/workflows/appstore-testflight.yml +++ b/.github/workflows/appstore-testflight.yml @@ -29,11 +29,10 @@ jobs: needs: check_date if: ${{ needs.check_date.outputs.should_run != 'false' }} continue-on-error: false - env: - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} steps: - - uses: actions/checkout@v4 + # note not using Turbo build as it caused a problem with missing assets + - name: Checkout repository + uses: actions/checkout@v4 - name: Cache node modules uses: actions/cache@v4 env: @@ -45,24 +44,10 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - name: Configure Turborepo Remote Cache - run: | - mkdir -p .turbo - if [ -n "${{ vars.TURBO_API_URL }}" ]; then - echo '{"apiurl": "${{ vars.TURBO_API_URL }}"}' > .turbo/config.json - echo "Turborepo config file created at .turbo/config.json" - else - echo "TURBO_API_URL not set. Skipping Turborepo cache configuration." - fi - if [ -n "$TURBO_TEAM" ] && [ -n "$TURBO_TOKEN" ]; then - echo "TURBO_TEAM and TURBO_TOKEN environment variables set" - 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 - + run: | + brew update + brew install jq - name: Declare some variables shell: bash run: | @@ -71,13 +56,13 @@ jobs: - name: Create version string shell: bash run: | - echo "version_string=v${{env.app_version}}-android-#${{env.sha_short}}" >> "$GITHUB_ENV" + echo "version_string=v${{env.app_version}}-ios-#${{env.sha_short}}" >> "$GITHUB_ENV" - name: Set up ruby env uses: ruby/setup-ruby@v1 with: ruby-version: 3.3.1 - bundler-cache: true # changed - was false because 'permissions issues?' + bundler-cache: true working-directory: app/ios/App - run: | cd app/ios/App @@ -101,7 +86,7 @@ jobs: export VITE_SHOW_WIPE=true export VITE_SHOW_MINIFAUXTON=true export VITE_CONDUCTOR_URL=${{vars.NIGHTLY_CONDUCTOR_URL}} - export VITE_TAG=prodAndroid + export VITE_TAG=prodIOS export VITE_NOTEBOOK_LIST_TYPE=${{vars.NOTEBOOK_LIST_TYPE}} export VITE_NOTEBOOK_NAME=${{vars.NOTEBOOK_NAME}} export VITE_THEME=${{vars.THEME}} @@ -117,26 +102,23 @@ jobs: npx cap update ios npx cap sync --deployment ios cd ios/App; pod install - #- run: chmod -R 777 /Users/runner/hostedtoolcache/Ruby/3.0.2/x64/lib/ruby/gems/ - name: Deploy iOS Beta to TestFlight via Fastlane uses: maierj/fastlane-action@v2.3.0 with: lane: closed_beta_testflight - subdirectory: 'ios/App' + subdirectory: 'app/ios/App' bundle-install-path: '$HOME/vendor/bundle' verbose: false env: APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' - DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}' - DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}' + DEVELOPER_APP_ID: '${{ vars.DEVELOPER_APP_ID }}' + APPLE_BUNDLE_IDENTIFIER: '${{ vars.APPLE_BUNDLE_IDENTIFIER }}' DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}' FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}' FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}' GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}' - TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}' - TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}' APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' diff --git a/.github/workflows/fieldmark-google-play-prod.yml b/.github/workflows/fieldmark-google-play-prod.yml index 08003d5e7..1a8a3e2b3 100644 --- a/.github/workflows/fieldmark-google-play-prod.yml +++ b/.github/workflows/fieldmark-google-play-prod.yml @@ -8,9 +8,6 @@ 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 }} steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 @@ -25,20 +22,6 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - name: Configure Turborepo Remote Cache - run: | - mkdir -p .turbo - if [ -n "${{ vars.TURBO_API_URL }}" ]; then - echo '{"apiurl": "${{ vars.TURBO_API_URL }}"}' > .turbo/config.json - echo "Turborepo config file created at .turbo/config.json" - else - echo "TURBO_API_URL not set. Skipping Turborepo cache configuration." - fi - if [ -n "$TURBO_TEAM" ] && [ -n "$TURBO_TOKEN" ]; then - echo "TURBO_TEAM and TURBO_TOKEN environment variables set" - 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 diff --git a/.github/workflows/nightly-android-testbuild.yml b/.github/workflows/nightly-android-testbuild.yml index 781393b1a..f8a93fef3 100644 --- a/.github/workflows/nightly-android-testbuild.yml +++ b/.github/workflows/nightly-android-testbuild.yml @@ -29,9 +29,6 @@ jobs: needs: check_date if: ${{ needs.check_date.outputs.should_run != 'false' }} continue-on-error: false - env: - TURBO_TEAM: ${{ vars.TURBO_TEAM }} - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} steps: - uses: actions/checkout@v4 - name: Cache node modules @@ -45,20 +42,6 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - name: Configure Turborepo Remote Cache - run: | - mkdir -p .turbo - if [ -n "${{ vars.TURBO_API_URL }}" ]; then - echo '{"apiurl": "${{ vars.TURBO_API_URL }}"}' > .turbo/config.json - echo "Turborepo config file created at .turbo/config.json" - else - echo "TURBO_API_URL not set. Skipping Turborepo cache configuration." - fi - if [ -n "$TURBO_TEAM" ] && [ -n "$TURBO_TOKEN" ]; then - echo "TURBO_TEAM and TURBO_TOKEN environment variables set" - 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 diff --git a/app/.github/workflows/google-play-build.yml.disabled b/app/.github/workflows/google-play-build.yml.disabled deleted file mode 100644 index d5d8c0561..000000000 --- a/app/.github/workflows/google-play-build.yml.disabled +++ /dev/null @@ -1,173 +0,0 @@ ---- -# Nightly compile for e2e testing -name: Deploy to Google Play Internal Testing Track -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions - -# TODO To be combined into human app build when it works. - -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - # push: - # branches: - # - github-actions - # - main - - workflow_dispatch: - schedule: - - cron: '30 22 * * 1-5' - # 0 is sunday - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v3 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - - node-deb-gh-build-play: - # The type of runner that the job will run on - # https://github.com/Apple-Actions/Example-iOS/blob/master/.github/workflows/test.yml - runs-on: ubuntu-latest - needs: check_date - continue-on-error: true - strategy: - matrix: - node-version: ['20'] - # 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 - - name: Cache node modules - uses: actions/cache@v3 - 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: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - # 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 - 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 - 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 - with: - distribution: 'adopt' - java-version: '17' - # https://www.runway.team/blog/ci-cd-pipeline-android-app-fastlane-github-actions - # Because fastlane stuff is in android, we need working-directory - - name: Set up ruby env - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7.5 - 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 "::set-output name=value::$(bin/getDescribeString.sh gh-play)" - shell: bash - - name: Decode Service Account Key JSON File - uses: timheuer/base64-to-file@v1 - id: service_account_json_file - with: - fileName: "fastlane-android-google-play-key.json" - encodedString: ${{ secrets.GPLAY_SERVICE_ACCOUNT_KEY_JSON }} - - name: Decode Keystore File - uses: timheuer/base64-to-file@v1 - id: android_keystore - with: - fileName: "android-signing-keystore.jks" - encodedString: ${{ secrets.KEYSTORE_FILE }} - # https://github.com/android-actions/setup-android - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - name: Building webapp - run: | - export platform="github-actions-play" - export serverprefix="testing" - export REACT_APP_CLUSTER_ADMIN_GROUP_NAME=cluster-admin - export REACT_APP_COMMIT_VERSION=$(bin/getDescribeString.sh gh-play) - export REACT_APP_DEBUG_APP=true - export REACT_APP_DEBUG_POUCHDB=false - export REACT_APP_USE_HTTPS=true - export REACT_APP_SHOW_WIPE=true - export REACT_APP_SHOW_NEW_NOTEBOOK=true - export REACT_APP_SHOW_MINIFAUXTON=true - export REACT_APP_DIRECTORY_HOST=demo.db.faims.edu.au - export REACT_APP_DIRECTORY_PORT=443 - export REACT_APP_PRODUCTION_BUILD=true - export REACT_APP_SERVICES=FAIMSTEXT - export REACT_APP_TAG=testingAndroid - export REACT_APP_PROD_BUILD=true - export REACT_APP_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} - git clean -xfd - 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 - - name: Fastlane - run: | - cd android - bundle install - bundle exec fastlane deploy_testing_github - env: - JAVA_KEYSTORE: ${{ steps.android_keystore.outputs.filePath }} - JAVA_KEYSTORE_PASSWORD: ${{ secrets.JAVA_KEYSTORE_PASSWORD }} - JAVA_KEY: ${{ secrets.JAVA_KEY}} - JAVA_KEY_PASSWORD: ${{ secrets.JAVA_KEY_PASSWORD }} - ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }} - serverprefix: "testing" - prnum: ${{steps.prnum.outputs.value}} - # - run: cd android && ./gradlew assembleDebug - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: assets - path: | - ${{ github.workspace }}/android/app/build/outputs/bundle/release - # - uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "latest-android" - # prerelease: true - # title: "Android APK Development Build" - # files: | - # LICENSE - # *.apk - \ No newline at end of file diff --git a/app/.github/workflows/human-app-build.yml.disabled b/app/.github/workflows/human-app-build.yml.disabled deleted file mode 100644 index ddcd71945..000000000 --- a/app/.github/workflows/human-app-build.yml.disabled +++ /dev/null @@ -1,121 +0,0 @@ ---- -# Nightly compile for e2e testing -name: Nightly iOS build -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions - -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - # push: - # branches: - # - github-actions - # - main - - workflow_dispatch: - - schedule: - - cron: '39 20 * * 1-5' - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v3 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - - ios-deploy: - name: Deploying to Testflight - runs-on: macOS-latest - needs: check_date - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Set up ruby env - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0.2 - bundler-cache: false - # No cache because permissions issues? - - run: | - bundle install # to get cocoapods... - bundle exec fastlane install_plugins - - name: Use Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: 'npm' - - name: Building webapp - run: | - export platform="github-actions-play" - export serverprefix="testing" - export REACT_APP_CLUSTER_ADMIN_GROUP_NAME=cluster-admin - export REACT_APP_COMMIT_VERSION=$(bin/getDescribeString.sh gh-play) - export REACT_APP_DEBUG_APP=true - export REACT_APP_DEBUG_POUCHDB=false - export REACT_APP_USE_HTTPS=true - export REACT_APP_SHOW_WIPE=true - export REACT_APP_SHOW_NEW_NOTEBOOK=true - export REACT_APP_SHOW_MINIFAUXTON=true - export REACT_APP_DIRECTORY_HOST=testing.db.faims.edu.au - export REACT_APP_DIRECTORY_PORT=443 - export REACT_APP_PRODUCTION_BUILD=true - export REACT_APP_SERVICES=FAIMSTEXT - export REACT_APP_TAG=testingAndroid - export REACT_APP_PROD_BUILD=true - export REACT_APP_BUGSNAG_KEY=${{secrets.BUGSNAG_KEY}} - git clean -xfd - npm ci - npm run build - # env: - # VITE_LOGIN_TOKEN: '{"token": "${{ secrets.JWT_TEST_TOKEN }}", "pubkey": "${{ secrets.JWT_SERVER_FLATTENED_PUBKEY }}", "pubalg": "RS256"}' - - # export VITE_LOGIN_TOKEN="${{ secrets.JWT_TEST_TOKEN }}" - # https://capacitorjs.com/docs/android - - run: npx cap update ios - - run: npx cap sync --deployment ios - - run: cd ios/App; pod install - - run: chmod -R 777 /Users/runner/hostedtoolcache/Ruby/3.0.2/x64/lib/ruby/gems/ - - name: Deploy iOS Beta to TestFlight via Fastlane - uses: maierj/fastlane-action@v2.3.0 - with: - lane: closed_beta_testflight - subdirectory: 'ios/App' - bundle-install-path: '$HOME/vendor/bundle' - verbose: false - env: - VITE_LOGIN_TOKEN: "${{ secrets.JWT_TEST_TOKEN }}" - APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' - DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}' - DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}' - DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}' - FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}' - FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' - MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}' - GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' - PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}' - TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}' - TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}' - APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' - APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' - APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' - BROWSERSTACK_USERNAME: '${{secrets.BROWSERSTACK_USERNAME}}' - BROWSERSTACK_ACCESS_KEY: '${{secrets.BROWSERSTACK_ACCESS_KEY}}' - - name: Archive ipas - uses: actions/upload-artifact@v3 - with: - name: ipa - path: | - /Users/runner/work/FAIMS3/FAIMS3/ios/App/App.ipa \ No newline at end of file diff --git a/app/.github/workflows/integration_tests.yml.disabled b/app/.github/workflows/integration_tests.yml.disabled deleted file mode 100644 index d777876ed..000000000 --- a/app/.github/workflows/integration_tests.yml.disabled +++ /dev/null @@ -1,79 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Integration tests - -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - push: - branches: - - main - - staging - - trying - pull_request: - branches: - - main - - staging - - trying - # Also trigger on page_build, as well as release created events - page_build: - release: - types: # This configuration does not affect the page_build event above - - created - - -jobs: - test: - # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error - runs-on: ubuntu-latest - services: - couchdb: - image: couchdb:3 - ports: - - 5984:5984 - env: - COUCHDB_USER: admin - COUCHDB_PASSWORD: password - env: - COUCHDB_USER: admin - COUCHDB_PASSWORD: password - REACT_APP_DIRECTORY_HOST: localhost - REACT_APP_USE_REAL_DATA: true - REACT_APP_PRODUCTION_BUILD: false - COUCHDB_CURL_HOST: http://admin:password@localhost:5984 - continue-on-error: ${{ matrix.experimental }} - strategy: - matrix: - node-version: ['20'] # '14' - experimental: [false] # We know everything after 16 is broken because React. - # include: - # - node-version: 'current' - # experimental: true # https://www.npmjs.com/package/@pkgjs/nv ? maybe? - # - node-version: 'latest' - # experimental: true # https://www.npmjs.com/package/@pkgjs/nv ? maybe? - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - # setup CORS for couchdb - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/httpd/enable_cors -d '"true"' - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/cors/origins -d '"*"' - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/cors/origins -d '"http://localhost"' - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/cors/credentials -d '"true"' - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"' - - run: curl -X PUT $COUCHDB_CURL_HOST/_node/_local/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"' - # setup basic db content - - name: Initialise couchdb - run: | - source bin/couchdb_initialisation.sh - initialise_couchdb http localhost 5984 $COUCHDB_USER $COUCHDB_PASSWORD - - run: curl http://localhost:5984/directory/_all_docs - # do the npm stuff - - run: npm ci - - run: npm run integration diff --git a/app/.github/workflows/nightly_browserstack.yml.disabled b/app/.github/workflows/nightly_browserstack.yml.disabled deleted file mode 100644 index 0bdbbf938..000000000 --- a/app/.github/workflows/nightly_browserstack.yml.disabled +++ /dev/null @@ -1,330 +0,0 @@ ---- -# Nightly compile for e2e testing -name: Nightly Compile APK to BrowserStack -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -on: - # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule - # This is UTC. For dev timing look at https://www.worldtimebuddy.com/?pl=1&lid=2147714,100,2063523&h=2147714&hf=1 - # https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events - # Note: The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. To decrease the chance of delay, schedule your workflow to run at a different time of the hour. - schedule: - - cron: '39 22 * * 2-6' - -# It's great having an on schedule, but bloody impossible to test. -# on: -# # Trigger the workflow on push or pull request, -# # but only for the main branch -# push: -# branches: -# - github-actions -# pull_request: -# branches: -# - github-actions - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v2 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" - node-deb-android-job: - # https://github.community/t/trigger-action-on-schedule-only-if-there-are-changes-to-the-branch/17887/4 - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false' }} - # The type of runner that the job will run on - # https://github.com/Apple-Actions/Example-iOS/blob/master/.github/workflows/test.yml - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - node-version: ['16'] - # 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@v2 - with: - ref: browserstack - # This is to check out rini's branch - - - name: Cache node modules - uses: actions/cache@v2 - 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: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-gradle - - name: Cache Gradle packages - uses: actions/cache@v2 - 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@v2 - 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 JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - # https://github.com/android-actions/setup-android - - name: Setup Android SDK - uses: android-actions/setup-android@v2.0.6 - - name: Building webapp - run: | - export REACT_APP_PRODUCTION_BUILD=true - export REACT_APP_DIRECTORY_HOST=alpha.db.faims.edu.au - export REACT_APP_COMMIT_VERSION=$(bin/getDescribeString.sh android) - git clean -xfd - npm ci - npm run build - # https://capacitorjs.com/docs/android - - run: npx cap sync --deployment android - # Sync runs copy then update - #- run: npx cap copy android - # - run: npx cap update android - - # Builds for debian, presently out of scope. - - # # build local deb - # - run: npm run dist - # - run: cp "$(find . -name '*.deb')" . - # - name: Archive deb - # uses: actions/upload-artifact@v2 - # with: - # name: ubuntu-deb - # path: | - # ./*.deb - - name: Archive build - uses: actions/upload-artifact@v2 - with: - name: npm-build - path: | - build - android - # Don't need to explicitly unzip - # https://github.com/oxr463/setup-cordova - # This is a docker build, so I don't think any of the caching will do any good... - # This is also using gradle 5.7 instead of 7, so we'll have to rebuild this. - # - name: Use oxr463/setup-cordova - # uses: oxr463/setup-cordova@0.0.2 - # with: - # exec: | - # cordova platform add android && \ - # cordova build --no-telemetry && \ - # echo "$(find . -name '*.apk')" && \ - # cp "$(find . -name '*.apk')" . - # https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows - - # https://github.com/marketplace/actions/setup-ionic - # - name: Use coturiv/setup-ionic - # uses: coturiv/setup-ionic@v1 - # with: - # cordova-version: 9 - # - name: Build - # run: | - # cordova platform add android - # cordova build --no-telemetry - - # https://cordova.apache.org/docs/en/latest/guide/cli/ - # We need to make sure to cache this, but ... later - # - run: sudo npm install -g cordova # This installs cordova 10. We'll want to staple it to a specific major version. - # - run: cordova platform add android # Again, adding that... locally. How odd. - # - run: cordova requirements - # - run: cordova build android - # limiting scope to only android here. - # - run: sudo npm install -g cordova - # https://forum.ionicframework.com/t/how-to-build-apk-from-capacitor-ionic-poject-without-using-android-studio/177814/7 - # setting the environment variable app_url with the output of this cURL. - # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter - - run: cd android && ./gradlew assembleDebug - - run: cp "$(find . -name '*.apk')" . - - name: "Upload APK to Browserstack with curl" - run: | - curl --silent --show-error --fail -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./app-debug.apk" -F "custom_id=Alpha-Github-Actions" | jq .app_url -M | xargs -I{} echo "app_url={}" >> $GITHUB_ENV - - name: Archive apks - uses: actions/upload-artifact@v2 - with: - name: apks - path: | - ./*.apk - # https://www.browserstack.com/docs/automate/selenium/github-actions#set-up-a-github-workflow-to-run-browserstack-tests - # Thereafter, invoke setup-env BrowserStack Action to set up - # environment variables in the runner - # browserstack_job: - # needs: [node-deb-android-job, check_date] - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - - # - name: Cache node modules - # uses: actions/cache@v2 - # 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: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - # - name: Use Node.js ${{ matrix.node-version }} - # uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node-version }} - # # run it every time... - # - run: npm install - # # Final part of the path is the custom id above. Should be a variable. Will fix later. - # - name: Get App Metadata - # uses: satak/webrequest-action@master - # with: - # url: https://api-cloud.browserstack.com/app-automate/recent_apps/ElaborationApp - # method: GET - # username: ${{ secrets.BROWSERSTACK_USERNAME }} - # password: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - - name: 'BrowserStack Env Setup' - uses: 'browserstack/github-actions/setup-env@master' - with: - username: '${{ secrets.BROWSERSTACK_USERNAME }}' - access-key: '${{ secrets.BROWSERSTACK_ACCESS_KEY }}' - # build-name: (Optional) Sets the environment variable BROWSERSTACK_BUILD_NAME - # build-name: 'BUILD_INFO' - # project-name: (Optional) Sets the environment variable BROWSERSTACK_PROJECT_NAME - # project-name: 'REPO_NAME' - # # Invoke setup-local BrowserStack Action to set up a tunnel connection - # # between the GitHub Actions runner environment and the BrowserStack - # # device cloud so that the application server on the runner environment - # # can be accessed by the browsers in BrowserStack's device cloud - - name: 'BrowserStackLocal Setup' - uses: 'browserstack/github-actions/setup-local@master' - with: - local-testing: start - local-identifier: random - local-logging-level: all-logs - local-args: --log-file '$GITHUB_WORKSPACE/browserstack.log' - # https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven - - name: Set up JDK 13 - uses: actions/setup-java@v2 - with: - java-version: '13' - distribution: 'adopt' - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Build with Maven - run: | - cd e2e - echo "::group::Mvn Install" - mvn install - echo "::endgroup::" - - name: Archive log - if: ${{ always() }} # - name: Archive log https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions - uses: actions/upload-artifact@v2 - with: - name: log - path: | - ./mavenTests.log - # https://blog.mindorks.com/github-actions-for-android - - # curl -u ":" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@/path/to/app/file/Application-debug.apk" - - # https://raw.githubusercontent.com/shreyanshp/upload-app-browserstack/master/README.md - # TRAP - # - uses: actions/upload-app-browserstack@v1 - # with: - # app-path: ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk - # browserstack-username: ${{ secrets.BROWSERSTACK_USERNAME }} - # browserstack-accesskey: ${{ secrets.BROWSERSTACK_ACCESSKEY }} - # Note: To be able to run these test scripts in the GitHub Actions runner environment, you have to add a step(s) in the workflow to install the required Selenium bindings for the language of your choice. - # https://www.browserstack.com/docs/automate/selenium/github-actions#sample-github-workflow-showing-a-browserstack-test - - # CustomURL - # https://www.browserstack.com/docs/app-automate/appium/upload-app-define-custom-id - # new run, need to check out the repo again. - - # - run: pwd - # - run: ls -alR - # - name: 'Running test on BrowserStack' # Invokes the actual test script that would run on BrowserStack browsers - # run: npm run browserstack - # env: - # BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - # BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - # GITHUB_COMMIT_MESSAGE: '${{ github.event.head_commit.message }} - ${{ github.sha}}' - # BUILD: ${{ github.repository }} - # # Running it from the npm runner rather than node might fix path issues? - # # ***IMPORTANT*** - # # If you do not stop the binary after the completion of your tests, the logs will not be uploaded as artifacts. - - name: 'BrowserStackLocal Stop' - uses: 'browserstack/github-actions/setup-local@master' - with: - local-testing: stop - # https://github.com/marketplace/actions/curl-axiosjs - # Why am I wrapping curl in JS? WHY? - # - name: 'Get list of recent sessions' - # uses: indiesdev/curl@v1 - # with: - # url: "https://api-cloud.browserstack.com/app-automate/builds.json" - # method: 'GET' - # basic-auth: "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" - # - name: 'Use response' - # run: echo ${{ steps.api.outputs.response }} - # - name: "Install jq to parse curl output" - # run: sudo apt install jq -y - # - name: "get build id" - # run: curl --silent --show-error --fail -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" -X GET "https://api-cloud.browserstack.com/app-automate/builds.json" | jq -cr '.[][] | select(.name=="${{ github.repository }}") | .hashed_id' | xargs -I{} echo ::set-output name=BUILD_ID::{} - # id: build-id - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions - # - run: echo "${{ steps.build-id.outputs.BUILD_ID}}" - # - name: "Get Sessions of build: ${{ github.repository }}" - # run: curl --silent --show-error --fail -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" -X GET "https://api-cloud.browserstack.com/app-automate/builds/${{steps.build-id.outputs.BUILD_ID}}/sessions.json" > sessions.json - # - run: cat sessions.json | jq -cr '.[][] | .appium_logs_url' | xargs -I{} echo ::set-output name=appium_log::{} - # id: appium-log-url - # - name: "fetching appium log from: ${{steps.appium-log-url.outputs.appium_log}}" - # run: curl --silent --show-error --fail -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" -X GET ${{steps.appium-log-url.outputs.appium_log}} > appium.log - # - run: cat sessions.json | jq -cr '.[][] | .public_url' | xargs -I{} echo ::set-output name=public_url::{} - # id: sessions-json - # - name: Archive appium log - # uses: actions/upload-artifact@v2 - # with: - # name: logs - # path: | - # ./*.log - # ./*.json - # - name: "Find errors in appium log" - # run: | - # echo ::set-output name=error-count::$(grep -i "Error" appium.log | wc -l) - # id: error-count - # - run: | - # echo "Public build URL: ${{steps.sessions-json.outputs.public_url}}" - # - name: "List errors" - # run: | - # echo "::error::${{steps.error-count.outputs.error-count}} testing-errors encountered on Browserstack run." - # grep "Encountered internal error" appium.log - # echo "::error::For details: ${{steps.sessions-json.outputs.public_url}}" - # if: ${{ steps.error-count.outputs.error-count > 0}} diff --git a/app/.github/workflows/pr-test-apk.yml.disabled b/app/.github/workflows/pr-test-apk.yml.disabled deleted file mode 100644 index 62466c8f4..000000000 --- a/app/.github/workflows/pr-test-apk.yml.disabled +++ /dev/null @@ -1,166 +0,0 @@ ---- -# Nightly compile for e2e testing -name: Integration test for Android compile, no upload -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch -# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions - - -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - # push: - # branches: - # - github-actions - # - main - - workflow_dispatch: - push: - branches: - - main - - staging - - trying - pull_request: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - node-deb-android-job-no-release: - # The type of runner that the job will run on - # https://github.com/Apple-Actions/Example-iOS/blob/master/.github/workflows/test.yml - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - node-version: ['20'] - # 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 - - - name: Cache node modules - uses: actions/cache@v3 - 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: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - # 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 - 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 - 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 - with: - distribution: 'adopt' - java-version: '17' - # https://github.com/android-actions/setup-android - - name: Setup Android SDK - uses: android-actions/setup-android@v2 - - name: Building webapp - run: | - export REACT_APP_CLUSTER_ADMIN_GROUP_NAME=cluster-admin - export REACT_APP_COMMIT_VERSION=$(bin/getDescribeString.sh android) - export REACT_APP_DEBUG_APP=true - export REACT_APP_DEBUG_POUCHDB=false - export REACT_APP_USE_HTTPS=true - export REACT_APP_SHOW_WIPE=true - export REACT_APP_SHOW_NEW_NOTEBOOK=true - export REACT_APP_SHOW_MINIFAUXTON=true - export REACT_APP_DIRECTORY_HOST=testing.db.faims.edu.au - export REACT_APP_DIRECTORY_PORT=443 - export REACT_APP_PRODUCTION_BUILD=true - export REACT_APP_SERVICES=FAIMSTEXT - export REACT_APP_TAG=testingAndroid - export REACT_APP_PROD_BUILD=true - git clean -xfd - npm ci - npm run build - # https://capacitorjs.com/docs/android - - run: npx cap sync --deployment android - # Sync runs copy then update - #- run: npx cap copy android - #- run: npx cap update android - # Builds for debian, presently out of scope. - - # # build local deb - # - run: npm run dist - # - run: cp "$(find . -name '*.deb')" . - # - name: Archive deb - # uses: actions/upload-artifact@v2 - # with: - # name: ubuntu-deb - # path: | - # ./*.deb - # Don't need to explicitly unzip - # https://github.com/oxr463/setup-cordova - # This is a docker build, so I don't think any of the caching will do any good... - # This is also using gradle 5.7 instead of 7, so we'll have to rebuild this. - # - name: Use oxr463/setup-cordova - # uses: oxr463/setup-cordova@0.0.2 - # with: - # exec: | - # cordova platform add android && \ - # cordova build --no-telemetry && \ - # echo "$(find . -name '*.apk')" && \ - # cp "$(find . -name '*.apk')" . - # https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows - - # https://github.com/marketplace/actions/setup-ionic - # - name: Use coturiv/setup-ionic - # uses: coturiv/setup-ionic@v1 - # with: - # cordova-version: 9 - # - name: Build - # run: | - # cordova platform add android - # cordova build --no-telemetry - - # https://cordova.apache.org/docs/en/latest/guide/cli/ - # We need to make sure to cache this, but ... later - # - run: sudo npm install -g cordova # This installs cordova 10. We'll want to staple it to a specific major version. - # - run: cordova platform add android # Again, adding that... locally. How odd. - # - run: cordova requirements - # - run: cordova build android - # limiting scope to only android here. - # - run: sudo npm install -g cordova - # https://forum.ionicframework.com/t/how-to-build-apk-from-capacitor-ionic-poject-without-using-android-studio/177814/7 - # setting the environment variable app_url with the output of this cURL. - # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter - - run: cd android && ./gradlew assembleDebug - - run: cp "$(find . -name '*.apk')" . - # - name: "Upload APK to Browserstack with curl" - # run: | - # curl --silent --show-error --fail -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@./app-debug.apk" -F "custom_id=Alpha-Github-Actions" | jq .app_url -M | xargs -I{} echo "app_url={}" >> $GITHUB_ENV - - name: Archive apks - uses: actions/upload-artifact@v2 - with: - name: apks - path: | - ./*.apk - # - uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "latest-android" - # prerelease: true - # title: "Android APK Development Build" - # files: | - # LICENSE - # *.apk - # https://www.browserstack.com/docs/automate/selenium/github-actions#set-up-a-github-workflow-to-run-browserstack-tests - # Thereafter, invoke setup-env BrowserStack Action to set up - # environment variables in the runner - \ No newline at end of file diff --git a/app/.github/workflows/pr-test-ios.yml.disabled b/app/.github/workflows/pr-test-ios.yml.disabled deleted file mode 100644 index 4a21c0261..000000000 --- a/app/.github/workflows/pr-test-ios.yml.disabled +++ /dev/null @@ -1,77 +0,0 @@ -name: Integration test for Apple compile, no upload -on: - # Allows you to run this workflow manually from the Actions a tab - workflow_dispatch: - push: - branches: - - main - - staging - - trying - pull_request: - branches: - - main - - staging - - trying -jobs: - deploy: - name: Running Fastlane - runs-on: macOS-latest - continue-on-error: true - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0.2' - # bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - run: | - bundle install # to get cocoapods... - - run: fastlane install_plugins - - name: Use Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'npm' - - name: Building webapp - run: | - export REACT_APP_PRODUCTION_BUILD=true - export REACT_APP_DIRECTORY_HOST=alpha.db.faims.edu.au - export REACT_APP_COMMIT_VERSION=$(bin/getDescribeString.sh ios) - git clean -xfd - npm ci - npm run build - # https://capacitorjs.com/docs/android - - run: npx cap update ios - - run: npx cap sync --deployment ios - - run: cd ios/App; pod install - - run: chmod -R 777 /Users/runner/hostedtoolcache/Ruby/3.0.2/x64/lib/ruby/gems/ - - name: Build iOS fastlane IPA - uses: maierj/fastlane-action@v2.3.0 - with: - lane: test_ipa - subdirectory: 'ios/App' - bundle-install-path: '$HOME/vendor/bundle' - verbose: false - env: - APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}' - DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}' - DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}' - DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}' - FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}' - FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}' - MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}' - GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}' - PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}' - TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}' - TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}' - APPLE_KEY_ID: '${{ secrets.APPLE_KEY_ID }}' - APPLE_ISSUER_ID: '${{ secrets.APPLE_ISSUER_ID }}' - APPLE_KEY_CONTENT: '${{ secrets.APPLE_KEY_CONTENT }}' - BROWSERSTACK_USERNAME: '${{secrets.BROWSERSTACK_USERNAME}}' - BROWSERSTACK_ACCESS_KEY: '${{secrets.BROWSERSTACK_ACCESS_KEY}}' - - name: Archive ipas - uses: actions/upload-artifact@v2 - with: - name: ipa - path: | - /Users/runner/work/FAIMS3/FAIMS3/ios/App/App.ipa \ No newline at end of file diff --git a/app/bin/prebuildConfig.sh b/app/bin/prebuildConfig.sh index c2f04414c..5c271e440 100755 --- a/app/bin/prebuildConfig.sh +++ b/app/bin/prebuildConfig.sh @@ -47,3 +47,23 @@ if test -f icons/icon-48.webp; then mkdir -p ./public/assets mv icons ./public/assets/icons fi + + +## IOS specific configuration + +# Setting the IOS build version +# https://pgu.dev/2020/12/16/ios-build-versioning.html + +#version=$(grep '"version":' $PROJECT_DIR/package.json | cut -d: -f 2 | sed -e 's/[", ]//g') +# since we previously published 1.0.0 on app store we need a higher version +# number, set that here until we get the main version above this +version=1.0.4 +buildNumber=$(date -u "+%Y%m%d%H%M") + +if test -f /usr/libexec/PlistBuddy; then + echo "\nIOS: Configuring Info.plist settings" + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ./ios/App/App/Info.plist + /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" ./ios/App/App/Info.plist + /usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLSchemes:0 $VITE_APP_ID" ./ios/App/App/Info.plist + /usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLName $VITE_APP_ID" ./ios/App/App/Info.plist +fi diff --git a/app/ios/App/App.xcodeproj/project.pbxproj b/app/ios/App/App.xcodeproj/project.pbxproj index 9f592a17a..aa6d01154 100644 --- a/app/ios/App/App.xcodeproj/project.pbxproj +++ b/app/ios/App/App.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ isa = PBXAggregateTarget; buildConfigurationList = D364126F278CFCD50019D84B /* Build configuration list for PBXAggregateTarget "Version" */; buildPhases = ( - D3641270278CFCD90019D84B /* ShellScript */, ); dependencies = ( ); @@ -236,26 +235,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - D3641270278CFCD90019D84B /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "$(SRCROOT)/Scripts/get_build_number.sh", - "$(SRCROOT)/App/Info.plist", - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$SRCROOT\"/Scripts/get_build_number.sh\n"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -428,7 +407,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; INFOPLIST_PREFIX_HEADER = Plist/Prefix; - INFOPLIST_PREPROCESS = YES; + INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -462,7 +441,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; INFOPLIST_PREFIX_HEADER = Plist/Prefix; - INFOPLIST_PREPROCESS = YES; + INFOPLIST_PREPROCESS = NO; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/app/ios/App/App/Info.plist b/app/ios/App/App/Info.plist index c4bc99d88..8f580bf94 100644 --- a/app/ios/App/App/Info.plist +++ b/app/ios/App/App/Info.plist @@ -17,20 +17,20 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.3 + 1.0.4 CFBundleURLTypes CFBundleURLName - $(PRODUCT_BUNDLE_IDENTIFIER) + au.edu.faims.fieldmark CFBundleURLSchemes - org.fedarch.faims3 + au.edu.faims.fieldmark CFBundleVersion - 202409110011 + 202412012317 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/app/ios/App/Gemfile b/app/ios/App/Gemfile new file mode 100644 index 000000000..b38f3c1ff --- /dev/null +++ b/app/ios/App/Gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "fastlane" +gem "cocoapods" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/app/ios/App/Gemfile.lock b/app/ios/App/Gemfile.lock index 8fbb89943..f6917f945 100644 --- a/app/ios/App/Gemfile.lock +++ b/app/ios/App/Gemfile.lock @@ -15,28 +15,28 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.936.0) - aws-sdk-core (3.196.1) + aws-partitions (1.1018.0) + aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.82.0) - aws-sdk-core (~> 3, >= 3.193.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.151.0) - aws-sdk-core (~> 3, >= 3.194.0) + aws-sdk-kms (1.96.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.176.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sigv4 (1.8.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -95,8 +95,8 @@ GEM escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.110.0) - faraday (1.10.3) + excon (0.112.0) + faraday (1.10.4) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -117,15 +117,15 @@ GEM faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - faraday_middleware (1.2.0) + faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.220.0) + fastlane (2.225.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -141,6 +141,7 @@ GEM faraday-cookie_jar (~> 0.0.6) faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) @@ -166,8 +167,10 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) - fastlane-plugin-browserstack (0.3.2) + fastlane-plugin-browserstack (0.3.3) rest-client (~> 2.0, >= 2.0.2) + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -188,7 +191,7 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.7.0) + google-cloud-core (1.7.1) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) @@ -210,31 +213,33 @@ GEM signet (>= 0.16, < 2.a) highline (2.0.3) http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.8.3) i18n (1.14.5) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.7.2) - jwt (2.8.1) + json (2.9.0) + jwt (2.9.3) base64 - mime-types (3.5.2) + logger (1.6.2) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0507) - mini_magick (4.12.0) + mime-types-data (3.2024.1203) + mini_magick (4.13.2) mini_mime (1.1.5) minitest (5.23.1) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.4.1) mutex_m (0.2.0) - nanaimo (0.3.0) + nanaimo (0.4.0) nap (1.1.0) naturally (2.2.1) netrc (0.11.0) nkf (0.2.0) - optparse (0.5.0) + optparse (0.6.0) os (1.1.4) plist (3.7.1) public_suffix (4.0.7) @@ -249,8 +254,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retriable (3.1.2) - rexml (3.2.8) - strscan (>= 3.0.9) + rexml (3.3.9) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) @@ -264,7 +268,7 @@ GEM simctl (1.6.10) CFPropertyList naturally - strscan (3.1.0) + sysrandom (1.0.5) terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -278,15 +282,15 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) word_wrap (1.0.0) - xcodeproj (1.24.0) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) diff --git a/app/ios/App/Scripts/get_build_number.sh b/app/ios/App/Scripts/get_build_number.sh deleted file mode 100755 index 599c830e1..000000000 --- a/app/ios/App/Scripts/get_build_number.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -euo pipefail -#https://pgu.dev/2020/12/16/ios-build-versioning.html - -#!/bin/sh -euo pipefail - -# Convert elapsed seconds from Unix epoch until now to minutes -# HOURS_SINCE_EPOCH=$(( $(date "+%s")/60/60 )) -# -# # Convert current git HEAD commit (7 characters) to decimal value -# #GIT_HASH_DECIMAL=$(printf "%d" 0x1"$(git rev-parse --short HEAD)") -# -# # Merge both values to a single string -# BUNDLE_VERSION="${HOURS_SINCE_EPOCH}"."${GIT_HASH_DECIMAL}" -# -# # Prepare directory / file where the generated value will be written. -# mkdir -p "${SRCROOT}"/Plist -# touch "${SRCROOT}"/Plist/Prefix -# -# # Write content to a file -# cat < "${SRCROOT}"/Plist/Prefix -# #define BUNDLE_VERSION ${BUNDLE_VERSION} -# EOF -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_DIR=$SCRIPT_DIR/../../../ - -#version=$(grep '"version":' $PROJECT_DIR/package.json | cut -d: -f 2 | sed -e 's/[", ]//g') -# since we previously published 1.0.0 on app store we need a higher version -# number, set that here until we get the main version above this -version=1.0.3 -buildNumber=$(date -u "+%Y%m%d%H%M") - -/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "App/Info.plist" -/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" "App/Info.plist" diff --git a/app/ios/App/fastlane/Appfile b/app/ios/App/fastlane/Appfile index 44862300a..f6dd73172 100644 --- a/app/ios/App/fastlane/Appfile +++ b/app/ios/App/fastlane/Appfile @@ -1,4 +1,4 @@ -app_identifier(ENV["DEVELOPER_APP_IDENTIFIER"]) +app_identifier(ENV["APPLE_BUNDLE_IDENTIFIER"]) apple_id(ENV["FASTLANE_APPLE_ID"]) itc_team_id(ENV["APP_STORE_CONNECT_TEAM_ID"]) team_id(ENV["DEVELOPER_PORTAL_TEAM_ID"]) diff --git a/app/ios/App/fastlane/Fastfile b/app/ios/App/fastlane/Fastfile index a7af27ad3..8dc94a116 100644 --- a/app/ios/App/fastlane/Fastfile +++ b/app/ios/App/fastlane/Fastfile @@ -3,83 +3,40 @@ update_fastlane default_platform(:ios) DEVELOPER_APP_ID = ENV["DEVELOPER_APP_ID"] -DEVELOPER_APP_IDENTIFIER = ENV["DEVELOPER_APP_IDENTIFIER"] +APPLE_BUNDLE_IDENTIFIER = ENV["APPLE_BUNDLE_IDENTIFIER"] PROVISIONING_PROFILE_SPECIFIER = ENV["PROVISIONING_PROFILE_SPECIFIER"] -TEMP_KEYCHAIN_USER = ENV["TEMP_KEYCHAIN_USER"] -TEMP_KEYCHAIN_PASSWORD = ENV["TEMP_KEYCHAIN_PASSWORD"] APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"] APPLE_KEY_ID = ENV["APPLE_KEY_ID"] APPLE_KEY_CONTENT = ENV["APPLE_KEY_CONTENT"] GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"] BROWSERSTACK_USERNAME = ENV["BROWSERSTACK_USERNAME"] BROWSERSTACK_ACCESS_KEY = ENV["BROWSERSTACK_ACCESS_KEY"] -def delete_temp_keychain(name) + + +# keychain details are hard-coded here with a generated password +KEYCHAIN_NAME = "keychain" +KEYCHAIN_PASSWORD = SecureRandom.hex(32) + +def delete_temp_keychain() delete_keychain( - name: name - ) if File.exist? File.expand_path("~/Library/Keychains/#{name}-db") + name: KEYCHAIN_NAME + ) if File.exist? File.expand_path("~/Library/Keychains/#{KEYCHAIN_NAME}-db") end -def create_temp_keychain(name, password) +def ensure_temp_keychain() + delete_temp_keychain() create_keychain( - name: name, - password: password, + name: KEYCHAIN_NAME, + password: KEYCHAIN_PASSWORD, unlock: false, timeout: 0 ) end -def ensure_temp_keychain(name, password) - delete_temp_keychain(name) - create_temp_keychain(name, password) -end - platform :ios do - lane :test_ipa do - keychain_name = TEMP_KEYCHAIN_USER - keychain_password = TEMP_KEYCHAIN_PASSWORD - ensure_temp_keychain(keychain_name, keychain_password) - - api_key = app_store_connect_api_key( - key_id: APPLE_KEY_ID, - issuer_id: APPLE_ISSUER_ID, - key_content: APPLE_KEY_CONTENT, - duration: 1200, - in_house: false - ) - - #increment_build_number(xcodeproj: "App.xcodeproj") - #handled by script and xcode in build phases, I hope. - - cocoapods( - clean_install: true - ) - - match( - type: 'development', - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", - git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), - readonly: false, - keychain_name: keychain_name, - keychain_password: keychain_password, - api_key: api_key - ) - - gym( - configuration: "Debug", - workspace: "App.xcworkspace", - scheme: "App", - export_method: "development", - export_options: { - provisioningProfiles: { - DEVELOPER_APP_ID => "match Development #{DEVELOPER_APP_IDENTIFIER}" - } - } - ) - end + lane :closed_beta_browserstack do - keychain_name = TEMP_KEYCHAIN_USER - keychain_password = TEMP_KEYCHAIN_PASSWORD - ensure_temp_keychain(keychain_name, keychain_password) + ensure_temp_keychain() api_key = app_store_connect_api_key( key_id: APPLE_KEY_ID, @@ -89,20 +46,17 @@ platform :ios do in_house: false ) - #increment_build_number(xcodeproj: "App.xcodeproj") - #handled by script and xcode in build phases, I hope. - cocoapods( clean_install: true ) match( type: 'development', - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", + app_identifier: "#{APPLE_BUNDLE_IDENTIFIER}", git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), readonly: false, - keychain_name: keychain_name, - keychain_password: keychain_password, + keychain_name: KEYCHAIN_NAME, + keychain_password: KEYCHAIN_PASSWORD, api_key: api_key ) @@ -113,7 +67,7 @@ platform :ios do export_method: "development", export_options: { provisioningProfiles: { - DEVELOPER_APP_ID => "match Development #{DEVELOPER_APP_IDENTIFIER}" + DEVELOPER_APP_ID => "match Development #{APPLE_BUNDLE_IDENTIFIER}" } } ) @@ -123,11 +77,13 @@ platform :ios do browserstack_access_key: "#{BROWSERSTACK_ACCESS_KEY}", custom_id: "ios-github-actions-fastlane" ) + + delete_temp_keychain() end + + lane :closed_beta_testflight do - keychain_name = TEMP_KEYCHAIN_USER - keychain_password = TEMP_KEYCHAIN_PASSWORD - ensure_temp_keychain(keychain_name, keychain_password) + ensure_temp_keychain() api_key = app_store_connect_api_key( key_id: APPLE_KEY_ID, @@ -146,11 +102,11 @@ platform :ios do match( type: 'appstore', - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", + app_identifier: "#{APPLE_BUNDLE_IDENTIFIER}", git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), readonly: false, - keychain_name: keychain_name, - keychain_password: keychain_password, + keychain_name: KEYCHAIN_NAME, + keychain_password: KEYCHAIN_PASSWORD, api_key: api_key ) @@ -161,7 +117,7 @@ platform :ios do export_method: "app-store", export_options: { provisioningProfiles: { - DEVELOPER_APP_ID => "match AppStore #{DEVELOPER_APP_IDENTIFIER}" + DEVELOPER_APP_ID => "match AppStore #{APPLE_BUNDLE_IDENTIFIER}" # AppStore needs app-store. Browserstack needs development } } @@ -171,10 +127,9 @@ platform :ios do merge_commit_filtering: "exclude_merges" ) - pilot( apple_id: "#{DEVELOPER_APP_ID}", - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", + app_identifier: "#{APPLE_BUNDLE_IDENTIFIER}", skip_waiting_for_build_processing: false, skip_submission: true, distribute_external: false, @@ -183,13 +138,11 @@ platform :ios do changelog: changelog ) - delete_temp_keychain(keychain_name) + delete_temp_keychain() end lane :production do - keychain_name = TEMP_KEYCHAIN_USER - keychain_password = TEMP_KEYCHAIN_PASSWORD - ensure_temp_keychain(keychain_name, keychain_password) + ensure_temp_keychain() api_key = app_store_connect_api_key( key_id: APPLE_KEY_ID, @@ -208,11 +161,11 @@ platform :ios do match( type: 'appstore', - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", + app_identifier: "#{APPLE_BUNDLE_IDENTIFIER}", git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), readonly: false, - keychain_name: keychain_name, - keychain_password: keychain_password, + keychain_name: KEYCHAIN_NAME, + keychain_password: KEYCHAIN_PASSWORD, api_key: api_key ) @@ -223,14 +176,14 @@ platform :ios do export_method: "app-store", export_options: { provisioningProfiles: { - DEVELOPER_APP_ID => "match AppStore #{DEVELOPER_APP_IDENTIFIER}" + DEVELOPER_APP_ID => "match AppStore #{APPLE_BUNDLE_IDENTIFIER}" # AppStore needs app-store. Browserstack needs development } } ) deliver( - app_identifier: "#{DEVELOPER_APP_IDENTIFIER}", + app_identifier: "#{APPLE_BUNDLE_IDENTIFIER}", ipa: "App.ipa", submit_for_review: false, automatic_release: false, @@ -238,6 +191,6 @@ platform :ios do run_precheck_before_submit: false ) - delete_temp_keychain(keychain_name) + delete_temp_keychain() end end diff --git a/app/ios/App/fastlane/Matchfile b/app/ios/App/fastlane/Matchfile index 88757e138..91d2d5762 100644 --- a/app/ios/App/fastlane/Matchfile +++ b/app/ios/App/fastlane/Matchfile @@ -1,13 +1,4 @@ git_url("https://github.com/FAIMS/fastlane-keys.git") app_identifier('au.edu.faims.electronicfieldnotebook') storage_mode("git") -type("appstore") # The default type, can be: appstore, adhoc, enterprise or development -# username("brian@faims.edu.au") - -# app_identifier(["tools.fastlane.app", "tools.fastlane.app2"]) -# username("user@fastlane.tools") # Your Apple Developer Portal username - -# For all available options run `fastlane match --help` -# Remove the # in the beginning of the line to enable the other options - -# The docs are available on https://docs.fastlane.tools/actions/match +type("appstore") diff --git a/app/src/gui/fields/qrcode/QRCodeFormField.tsx b/app/src/gui/fields/qrcode/QRCodeFormField.tsx index d830616a3..1e15e2cf7 100644 --- a/app/src/gui/fields/qrcode/QRCodeFormField.tsx +++ b/app/src/gui/fields/qrcode/QRCodeFormField.tsx @@ -276,7 +276,7 @@ export function QRCodeButton(props: QRCodeButtonProps): JSX.Element { ); } - if (canScan) { + if (!canScan) { return (