From ca7de6d6ae3bd8a27e99749c7031b92f23995bdc Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 4 Dec 2021 10:38:44 +0100 Subject: [PATCH] Unlock keychain after creation Might be the reason behind build hanging up in CI, arguably waiting for a keychain password prompt. Now, the issue never happened while prepping #207. When testing the PR though, the testing step was omitted. This drastically reduced the time between keychain creation and the build to reach the codesigning phase. By restoring tests in between, the increase in time would likely incur in keychain auto-locking up. - Convert action to keychain creation only - Restore xcpretty as irrelevant (2a5c231) --- .github/actions/create-keychain/action.yml | 23 ++++++++++++++++++++ .github/actions/prepare-build-app/action.yml | 18 --------------- .github/workflows/release.yml | 21 +++++++++++++----- Gemfile.lock | 4 +--- fastlane/Fastfile | 11 ---------- fastlane/Gymfile | 1 - fastlane/Pluginfile | 5 ----- 7 files changed, 40 insertions(+), 43 deletions(-) create mode 100644 .github/actions/create-keychain/action.yml delete mode 100644 .github/actions/prepare-build-app/action.yml delete mode 100644 fastlane/Pluginfile diff --git a/.github/actions/create-keychain/action.yml b/.github/actions/create-keychain/action.yml new file mode 100644 index 00000000..af30c019 --- /dev/null +++ b/.github/actions/create-keychain/action.yml @@ -0,0 +1,23 @@ +name: "Create custom keychain" +inputs: + name: + description: "Keychain name" + required: true + password: + description: "Keychain password" + required: true +runs: + using: "composite" + steps: + - shell: bash + env: + KEYCHAIN_NAME: ${{ inputs.name }} + KEYCHAIN_PASSWORD: ${{ inputs.password }} + run: | + bundle exec fastlane run create_keychain unlock:true lock_after_timeout:false + - uses: webiny/action-post-run@2.0.1 + env: + KEYCHAIN_NAME: ${{ inputs.name }} + with: + run: | + bundle exec fastlane run delete_keychain diff --git a/.github/actions/prepare-build-app/action.yml b/.github/actions/prepare-build-app/action.yml deleted file mode 100644 index 24e4234e..00000000 --- a/.github/actions/prepare-build-app/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'Prepare build environment' -inputs: - platform: - description: 'Platform for match' - required: true -runs: - using: 'composite' - steps: - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - shell: bash - run: | - scripts/ci/recognize-match-hostname.sh - bundle exec fastlane --env ${{ inputs.platform }} preinstall_development_certs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc7a2d42..9b033a5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,9 @@ name: Release on: push: branches: - - 'master' + - "master" paths: - - '.beta-build' + - ".beta-build" env: APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} @@ -45,10 +45,21 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: Prepare build - uses: ./.github/actions/prepare-build-app + - uses: ruby/setup-ruby@v1 with: - platform: ${{ matrix.platform }} + bundler-cache: true + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: Create keychain + uses: ./.github/actions/create-keychain + with: + name: ${{ env.MATCH_KEYCHAIN_NAME }} + password: ${{ env.MATCH_KEYCHAIN_PASSWORD }} + - name: Preinstall certificates (SSH) + run: | + scripts/ci/recognize-match-hostname.sh + bundle exec fastlane --env ${{ matrix.platform }} match development - name: Store app version id: app_version if: ${{ matrix.use_version }} diff --git a/Gemfile.lock b/Gemfile.lock index f963ea08..17b3ab45 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.537.0) + aws-partitions (1.539.0) aws-sdk-core (3.124.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -151,7 +151,6 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-appcenter (1.11.1) ffi (1.15.4) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -277,7 +276,6 @@ DEPENDENCIES cocoapods dotenv fastlane - fastlane-plugin-appcenter BUNDLED WITH 2.2.22 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 3fa72755..5ddbafab 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -14,14 +14,3 @@ # update_fastlane import("../Submodules/fastlane-ci-templates/fastlane/Fastfile.include") - -desc "Preinstall development certificates" -lane :preinstall_development_certs do - create_keychain( - name: ENV["MATCH_KEYCHAIN_NAME"], - password: ENV["MATCH_KEYCHAIN_PASSWORD"] - ) - match( - type: "development" - ) -end diff --git a/fastlane/Gymfile b/fastlane/Gymfile index 06c350ec..9ccb96f6 100644 --- a/fastlane/Gymfile +++ b/fastlane/Gymfile @@ -13,7 +13,6 @@ clean true silent false skip_profile_detection true -disable_xcpretty true build_path "build" derived_data_path "build/derived_data" diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile deleted file mode 100644 index 756bff8e..00000000 --- a/fastlane/Pluginfile +++ /dev/null @@ -1,5 +0,0 @@ -# Autogenerated by fastlane -# -# Ensure this file is checked in to source control! - -gem 'fastlane-plugin-appcenter'