Skip to content

Commit

Permalink
Debug App Store workflows (#1248)
Browse files Browse the repository at this point in the history
# Debug App Store workflows

## JIRA Ticket

None

## Description

Trying to get App Store build workflow working again.


## Checklist

- [x] I have confirmed all commits have been signed.
- [x] I have added JSDoc style comments to any new functions or classes.
- [x] Relevant documentation such as READMEs, guides, and class comments
are updated.
  • Loading branch information
stevecassidy authored Dec 9, 2024
2 parents f18be21 + a7044c9 commit e54149d
Show file tree
Hide file tree
Showing 22 changed files with 244 additions and 1,248 deletions.
97 changes: 52 additions & 45 deletions .github/workflows/appstore-deploy.yml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
42 changes: 12 additions & 30 deletions .github/workflows/appstore-testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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}}
Expand All @@ -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 }}'
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/fieldmark-google-play-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/nightly-android-testbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading

0 comments on commit e54149d

Please sign in to comment.