diff --git a/.github/workflows/publish-release-bte.yml b/.github/workflows/publish-release-bte.yml new file mode 100644 index 0000000000..17b063dab6 --- /dev/null +++ b/.github/workflows/publish-release-bte.yml @@ -0,0 +1,113 @@ +name: Publish Release Candidates BTE + +on: + push: + branches: + - bte-release + paths-ignore: + - 'package.json' + - 'CHANGELOG.md' + +jobs: + version_bump: + name: "Bump version" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + + - name: Bump version and push tag + uses: TriPSs/conventional-changelog-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + git-message: 'chore(release): {version}' + preset: 'angular' + tag-prefix: '' + output-file: 'CHANGELOG.md' + + deploy_ios: + runs-on: macOS-latest + needs: version_bump + steps: + - uses: actions/checkout@master + + - name: Set XCode Version + run: sudo xcode-select -s /Applications/Xcode_11.app + + - name: Cache node_modules/ + uses: actions/cache@v1 + id: node_cache + with: + path: node_modules + key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn-cache- + + - name: Install Node Dependencies + if: steps.node_cache.outputs.cache-hit != 'true' + run: yarn --frozen-lockfile + + - name: Install bundler for ruby package management + run: gem install bundler -v "$(grep -A 1 "BUNDLED WITH" ./Gemfile.lock | tail -n 1)" + working-directory: ./ios + + - name: Cache ruby gems + uses: actions/cache@v1 + id: ruby_cache + with: + path: ios/vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/ios/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Install Ruby Dependencies + if: steps.ruby_cache.outputs.cache-hit != 'true' + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + working-directory: ./ios + + - name: Install Cocoapods + run: bundle exec pod install --repo-update + working-directory: ./ios + + - name: Setup SSH Keys and known_hosts + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + mkdir -p ~/.ssh + ssh-keyscan github.com >> ~/.ssh/known_hosts + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.MATCH_SSH_CERT }}" + + - name: Build ios Release artifact + uses: maierj/fastlane-action@v1.4.0 + # The names of the keys for secrets are specific and meaningful to Match. + # Match password is responsible for decrypting the secrets from the cert repo + # Fastlane password is responsible for interacting with the App Store to validate certificates and profiles. + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + MATCH_GIT_BASIC_AUTH: ${{ secrets.MATCH_GIT_BASIC_AUTH }} + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + with: + lane: 'release_bte' + subdirectory: 'ios' + bundle-install-path: 'vendor/bundle' + + - name: Deploy to testflight + uses: maierj/fastlane-action@v1.4.0 + # The names of the keys for secrets are specific and meaningful to Match. + # Match password is responsible for decrypting the secrets from the cert repo + # Fastlane password is responsible for interacting with the App Store to validate certificates and profiles. + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + MATCH_GIT_BASIC_AUTH: ${{ secrets.MATCH_GIT_BASIC_AUTH }} + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + with: + lane: 'deploy' + subdirectory: 'ios' + bundle-install-path: 'vendor/bundle' diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index cf8c177139..3410c35929 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,11 +1,9 @@ -name: Publish Release Candidates +name: Publish Release Candidates GPS on: push: branches: - - develop - - release-candidate - - master + - gps-release paths-ignore: - 'package.json' - 'CHANGELOG.md' @@ -199,4 +197,4 @@ jobs: with: lane: 'deploy' subdirectory: 'ios' - bundle-install-path: 'vendor/bundle' \ No newline at end of file + bundle-install-path: 'vendor/bundle' diff --git a/.github/workflows/staging-android.yml b/.github/workflows/staging-android.yml index 720d1b2c0d..ca2e81c32d 100644 --- a/.github/workflows/staging-android.yml +++ b/.github/workflows/staging-android.yml @@ -1,16 +1,14 @@ -name: Staging Android +name: Staging Android GPS on: push: branches: - develop - master - - release-candidate pull_request: branches: - develop - master - - release-candidate jobs: build_staging_android: diff --git a/.github/workflows/staging-ios-bte.yml b/.github/workflows/staging-ios-bte.yml new file mode 100644 index 0000000000..f376640d64 --- /dev/null +++ b/.github/workflows/staging-ios-bte.yml @@ -0,0 +1,82 @@ +name: Staging iOS BTE + +# Deliberately turned off the pull request logic here +# because GitHub Actions explicitly turns off secrets for pull requests coming from a forked repo +on: + push: + branches: + - develop + - master + +jobs: + build_staging_ios: + runs-on: macOS-latest + steps: + - uses: actions/checkout@master + + - name: Set XCode Version + run: sudo xcode-select -s /Applications/Xcode_11.app + + - name: Cache node_modules/ + uses: actions/cache@v1 + id: node_cache + with: + path: node_modules + key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-yarn-cache- + + - name: Install Node Dependencies + if: steps.node_cache.outputs.cache-hit != 'true' + run: yarn --frozen-lockfile + + - name: Install bundler for ruby package management + run: gem install bundler -v "$(grep -A 1 "BUNDLED WITH" ./Gemfile.lock | tail -n 1)" + working-directory: ./ios + + - name: Cache ruby gems + uses: actions/cache@v1 + id: ruby_cache + with: + path: ios/vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/ios/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + - name: Install Ruby Dependencies + if: steps.ruby_cache.outputs.cache-hit != 'true' + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + working-directory: ./ios + + - name: Install Cocoapods + run: bundle exec pod install --repo-update + working-directory: ./ios + + - name: Setup SSH Keys and known_hosts + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + mkdir -p ~/.ssh + ssh-keyscan github.com >> ~/.ssh/known_hosts + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.MATCH_SSH_CERT }}" + + - name: Build BTE iOS Production artifact for devices + uses: maierj/fastlane-action@v1.4.0 + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} + MATCH_GIT_BASIC_AUTH: ${{ secrets.MATCH_GIT_BASIC_AUTH }} + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + with: + lane: 'staging_bte' + subdirectory: 'ios' + bundle-install-path: 'vendor/bundle' + + - name: Upload Artifact + uses: actions/upload-artifact@v1 + with: + name: Debug IPA file (work in progress) + path: ios/COVIDSafePaths-bte.ipa diff --git a/.github/workflows/staging-ios.yml b/.github/workflows/staging-ios.yml index 99ef6b2133..c9798610e2 100644 --- a/.github/workflows/staging-ios.yml +++ b/.github/workflows/staging-ios.yml @@ -1,4 +1,4 @@ -name: Staging iOS +name: Staging iOS GPS # Deliberately turned off the pull request logic here # because GitHub Actions explicitly turns off secrets for pull requests coming from a forked repo @@ -7,7 +7,6 @@ on: branches: - develop - master - - release-candidate jobs: build_staging_ios: @@ -63,7 +62,7 @@ jobs: ssh-keyscan github.com >> ~/.ssh/known_hosts ssh-agent -a $SSH_AUTH_SOCK > /dev/null ssh-add - <<< "${{ secrets.MATCH_SSH_CERT }}" - + - name: Build iOS Staging artifact for devices uses: maierj/fastlane-action@v1.4.0 env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81bf1b8b0f..fcb0b84ff5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,13 +4,15 @@ on: push: branches: - develop - - release-candidate - master + - bte-release + - gps-release pull_request: branches: - develop - - release-candidate - master + - bte-release + - gps-release jobs: unit-test: diff --git a/ios/fastlane/Appfile b/ios/fastlane/Appfile index e7c3fb99d5..1eb8b8a780 100644 --- a/ios/fastlane/Appfile +++ b/ios/fastlane/Appfile @@ -1,8 +1,17 @@ -app_identifier("org.pathcheck.covid-safepaths") # The bundle identifier of your app apple_id("tech@pathcheck.org") # Your Apple email address itc_team_id("121372784") # App Store Connect Team ID team_id("79Z8HUPGC3") # Developer Portal Team ID +for_platform :ios do + for_lane :release_bte do + app_identifier "org.pathcheck.bt" + end + + for_lane :release do + app_identifier "org.pathcheck.covid-safepaths" + end +end + # For more information about the Appfile, see: -# https://docs.fastlane.tools/advanced/#appfile \ No newline at end of file +# https://docs.fastlane.tools/advanced/#appfile diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 588b3fab1d..de58aa4aed 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -28,15 +28,17 @@ before_all do end platform :ios do - - APP_ID = "org.pathcheck.covid-safepaths" - PROFILE = "match AppStore org.pathcheck.covid-safepaths" + BTE_APP_ID = "org.pathcheck.bt" + GPS_APP_ID = "org.pathcheck.covid-safepaths" + GPS_PROFILE = "match AppStore org.pathcheck.covid-safepaths" + BTE_PROFILE = "match AppStore org.pathcheck.bt" DEBUG_PROFILE = "match Develop org.pathcheck.covid-safepaths" ADHOC_PROFILE = "match AdHoc org.pathcheck.covid-safepaths" - STAGING_SCHEME = "Staging" - BETA_SCHEME = "Beta" + BTE_STAGING_SCHEME = "BTE_Staging" + GPS_STAGING_SCHEME = "GPS_Staging" TEAM = "79Z8HUPGC3" - SCHEME = "COVIDSafePaths" + BTE_SCHEME = "BTE_Production" + GPS_SCHEME = "GPS_Production" WORKSPACE = "COVIDSafePaths.xcworkspace" PROJECT = "COVIDSafePaths.xcodeproj" JS_PACKAGE = load_json(json_path: "../package.json") @@ -51,11 +53,11 @@ platform :ios do ) end - desc "Push a new staging build for automation" + desc "Push a new GPS Staging build for automation" lane :staging do signing_bundle_details = { - :BUNDLE_IDENTIFIER => APP_ID, + :BUNDLE_IDENTIFIER => GPS_APP_ID, :PROVISIONING_PROFILE_SPECIFIER => ADHOC_PROFILE, :DEVELOPMENT_TEAM => TEAM } @@ -70,7 +72,7 @@ platform :ios do build_ios_app( workspace: WORKSPACE, - scheme: STAGING_SCHEME, + scheme: GPS_STAGING_SCHEME, configuration: "Staging", export_method: "ad-hoc", silent: true, @@ -79,12 +81,11 @@ platform :ios do ) end - - desc "Push a new Beta build (AdHoc Signed Release build)" - lane :beta do + desc "Push a new BTE Staging build for automation" + lane :staging_bte do signing_bundle_details = { - :BUNDLE_IDENTIFIER => APP_ID, + :BUNDLE_IDENTIFIER => BTE_APP_ID, :PROVISIONING_PROFILE_SPECIFIER => ADHOC_PROFILE, :DEVELOPMENT_TEAM => TEAM } @@ -99,16 +100,16 @@ platform :ios do build_ios_app( workspace: WORKSPACE, - scheme: BETA_SCHEME, - configuration: "Beta", + scheme: BTE_STAGING_SCHEME, + configuration: "Staging", export_method: "ad-hoc", silent: true, clean: true, - output_name: "COVIDSafePaths-beta.ipa", + output_name: "COVIDSafePaths-bte-staging.ipa", ) end - desc "Push a new Release build to TestFlight" + desc "Push a new GPS Release build to TestFlight" lane :release do # Sets the app store version: # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion @@ -124,8 +125,8 @@ platform :ios do ) signing_bundle_details = { - :BUNDLE_IDENTIFIER => APP_ID, - :PROVISIONING_PROFILE_SPECIFIER => PROFILE, + :BUNDLE_IDENTIFIER => GPS_APP_ID, + :PROVISIONING_PROFILE_SPECIFIER => GPS_PROFILE, :DEVELOPMENT_TEAM => TEAM } @@ -134,15 +135,57 @@ platform :ios do readonly: false, keychain_name: "tech_at_safepaths_keychain", keychain_password: "meow", - git_basic_authorization: ENV["secrets.MATCH_GIT_BASIC_AUTH"] + git_basic_authorization: ENV["secrets.MATCH_GIT_BASIC_AUTH"], + app_identifier: 'org.pathcheck.covid-safepaths' + ) + + build_ios_app( + workspace: WORKSPACE, + scheme: GPS_SCHEME, + configuration: "Release", + silent: true, + clean: true, + output_name: "COVIDSafePaths.ipa", + ) + end + + desc "Push a new BTE Release build to TestFlight" + lane :release_bte do + # Sets the app store version: + # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion + increment_build_number( + xcodeproj: PROJECT, + build_number: JS_PACKAGE['version'] + ) + # Sets the system build number for the project: + # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring + increment_version_number( + xcodeproj: PROJECT, + version_number: JS_PACKAGE['version'] + ) + + signing_bundle_details = { + :BUNDLE_IDENTIFIER => BTE_APP_ID, + :PROVISIONING_PROFILE_SPECIFIER => BTE_PROFILE, + :DEVELOPMENT_TEAM => TEAM + } + + match( + type: 'appstore', + readonly: false, + keychain_name: "tech_at_safepaths_keychain", + keychain_password: "meow", + git_basic_authorization: ENV["secrets.MATCH_GIT_BASIC_AUTH"], + app_identifier: 'org.pathcheck.bt' ) build_ios_app( workspace: WORKSPACE, - scheme: SCHEME, + scheme: BTE_SCHEME, configuration: "Release", silent: true, clean: true, + output_name: "COVIDSafePaths-bte.ipa", ) end diff --git a/ios/fastlane/Matchfile b/ios/fastlane/Matchfile index 172e019afe..fb18ed8aed 100644 --- a/ios/fastlane/Matchfile +++ b/ios/fastlane/Matchfile @@ -1,6 +1,6 @@ git_url("git@github.com:Path-Check/certificates.git") storage_mode("git") -app_identifier(["org.pathcheck.covid-safepaths"]) +app_identifier(["org.pathcheck.covide-safepaths", "org.pathcheck.bt"]) username("tech@pathcheck.org") # Your Apple Developer Portal username # type("appstore") # Options: appstore, adhoc, enterprise or development diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index 185e713dc1..090a782c94 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -25,17 +25,22 @@ fastlane ios sync_local_certs ``` fastlane ios staging ``` -Push a new staging build for automation -### ios beta +Push a new GPS Staging build for automation +### ios staging_bte ``` -fastlane ios beta +fastlane ios staging_bte ``` -Push a new Beta build (AdHoc Signed Release build) +Push a new BTE Staging build for automation ### ios release ``` fastlane ios release ``` -Push a new Release build to TestFlight +Push a new GPS Release build to TestFlight +### ios release_bte +``` +fastlane ios release_bte +``` +Push a new BTE Release build to TestFlight ### ios deploy ``` fastlane ios deploy diff --git a/ios/ziCSLtqP b/ios/ziCSLtqP new file mode 100644 index 0000000000..351e282e30 Binary files /dev/null and b/ios/ziCSLtqP differ