From ebc6c428a8381fea6e6a65b3d0f9d47c0bde0da2 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 11:31:20 -0800 Subject: [PATCH 1/6] Update CI --- .github/workflows/xcodebuild-or-fastlane.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 637daa0..211fb85 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -46,6 +46,11 @@ on: required: false type: boolean default: false + cacheDerivedData: + description: 'Cache the derived data folder for a build using xcodebuild' + required: false + type: boolean + default: false setupfirebaseemulator: description: 'Setup the Firebase Emulator' required: false @@ -77,6 +82,7 @@ jobs: if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.scheme != ''" run: gem install xcpretty - name: Cache .derivedData folder + if: "inputs.cacheDerivedData" uses: actions/cache@v3 with: path: .derivedData From 2e54d90870f12419efbbbdca17cc2fa807713d41 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 13:57:48 -0800 Subject: [PATCH 2/6] Fix base64 --- .github/workflows/xcodebuild-or-fastlane.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 211fb85..20f4550 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -121,8 +121,8 @@ jobs: KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH # create temporary keychain security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH From 59dfc4d272fe4e9cc7e9dc33dd58a2647b1bdf57 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 19:42:27 -0800 Subject: [PATCH 3/6] Update GitHub Action --- .github/workflows/xcodebuild-or-fastlane.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 20f4550..87798b1 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -162,7 +162,7 @@ jobs: | xcpretty - name: Fastlane if: ${{ inputs.fastlanelane != '' }} - run: bundler install && bundle exec fastlane ${{ inputs.fastlanelane }} + run: fastlane ${{ inputs.fastlanelane }} env: APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} From 1c99c9cfbf92a297a55a463f442f52468604805d Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 20:50:52 -0800 Subject: [PATCH 4/6] Update CI --- .github/workflows/xcodebuild-or-fastlane.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 87798b1..937567f 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -20,7 +20,7 @@ on: description: 'JSON-based collection of labels indicating which type of github runner should be chosen' required: false type: string - default: '["macos-12"]' + default: '["macos-latest"]' scheme: description: 'The scheme in the Xcode project. Either use `scheme` to use xcodebuild, `fastlanelane` to use fastlane, or a custom command using `customcommand`' required: false @@ -67,7 +67,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 - if: "!contains(inputs.runsonlabels, 'self-hosted')" + if: "!env.action_state" with: xcode-version: latest-stable - name: Check environment @@ -79,7 +79,7 @@ jobs: echo "inputs.scheme: ${{ inputs.scheme }}" echo "inputs.setupsigning: ${{ inputs.setupsigning }}" - name: Install xcpretty - if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.scheme != ''" + if: "!env.action_state && inputs.scheme != ''" run: gem install xcpretty - name: Cache .derivedData folder if: "inputs.cacheDerivedData" @@ -90,22 +90,22 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-derivedData- - name: Cache Firebase Emulators - if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.setupfirebaseemulator" + if: "!env.action_state && inputs.setupfirebaseemulator" uses: actions/cache@v3 with: path: ~/.cache/firebase/emulators key: ${{ runner.os }}-${{ runner.arch }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }} - name: Setup NodeJS - if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.setupfirebaseemulator" + if: "!env.action_state && inputs.setupfirebaseemulator" uses: actions/setup-node@v3 - name: Setup Java - if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.setupfirebaseemulator" + if: "!env.action_state && inputs.setupfirebaseemulator" uses: actions/setup-java@v3 with: distribution: 'microsoft' java-version: '17' - name: Install Firebase CLI Tools - if: "!contains(inputs.runsonlabels, 'self-hosted') && inputs.setupfirebaseemulator" + if: "!env.action_state && inputs.setupfirebaseemulator" run: npm install -g firebase-tools - name: Install the Apple certificate and provisioning profile if: ${{ inputs.setupsigning }} @@ -175,7 +175,7 @@ jobs: name: ${{ inputs.artifactname }} path: ${{ inputs.artifactname }} - name: Clean up keychain and provisioning profile - if: "(inputs.setupsigning && contains(inputs.runsonlabels, 'self-hosted')) || failure()" + if: "(inputs.setupsigning && env.action_state) || failure()" run: | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision From 729ac6c6c181aad23f250c80a4c3e702498564e0 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 20:54:54 -0800 Subject: [PATCH 5/6] Update CI --- .github/workflows/xcodebuild-or-fastlane.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 937567f..42d4d0d 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -67,19 +67,25 @@ jobs: steps: - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 - if: "!env.action_state" + if: "!env.selfhosted" with: xcode-version: latest-stable - name: Check environment run: | xcodebuild -version swift --version + echo "env.selfhosted: ${{ env.selfhosted }}" echo "inputs.path: ${{ inputs.path }}" echo "inputs.runsonlabels: ${{ inputs.runsonlabels }}" echo "inputs.scheme: ${{ inputs.scheme }}" + echo "inputs.fastlanelane: ${{ inputs.fastlanelane }}" + echo "inputs.customcommand: ${{ inputs.customcommand }}" + echo "inputs.artifactname: ${{ inputs.artifactname }}" echo "inputs.setupsigning: ${{ inputs.setupsigning }}" + echo "inputs.cacheDerivedData: ${{ inputs.cacheDerivedData }}" + echo "inputs.setupfirebaseemulator: ${{ inputs.setupfirebaseemulator }}" - name: Install xcpretty - if: "!env.action_state && inputs.scheme != ''" + if: "!env.selfhosted && inputs.scheme != ''" run: gem install xcpretty - name: Cache .derivedData folder if: "inputs.cacheDerivedData" @@ -90,22 +96,22 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-derivedData- - name: Cache Firebase Emulators - if: "!env.action_state && inputs.setupfirebaseemulator" + if: "!env.selfhosted && inputs.setupfirebaseemulator" uses: actions/cache@v3 with: path: ~/.cache/firebase/emulators key: ${{ runner.os }}-${{ runner.arch }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }} - name: Setup NodeJS - if: "!env.action_state && inputs.setupfirebaseemulator" + if: "!env.selfhosted && inputs.setupfirebaseemulator" uses: actions/setup-node@v3 - name: Setup Java - if: "!env.action_state && inputs.setupfirebaseemulator" + if: "!env.selfhosted && inputs.setupfirebaseemulator" uses: actions/setup-java@v3 with: distribution: 'microsoft' java-version: '17' - name: Install Firebase CLI Tools - if: "!env.action_state && inputs.setupfirebaseemulator" + if: "!env.selfhosted && inputs.setupfirebaseemulator" run: npm install -g firebase-tools - name: Install the Apple certificate and provisioning profile if: ${{ inputs.setupsigning }} @@ -175,7 +181,7 @@ jobs: name: ${{ inputs.artifactname }} path: ${{ inputs.artifactname }} - name: Clean up keychain and provisioning profile - if: "(inputs.setupsigning && env.action_state) || failure()" + if: "(inputs.setupsigning && env.selfhosted) || failure()" run: | security delete-keychain $RUNNER_TEMP/app-signing.keychain-db rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision From 60bfc7deedc7cbee32711a6890ee0dbe2a1f9568 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Thu, 23 Feb 2023 21:01:51 -0800 Subject: [PATCH 6/6] Improve CI --- .github/workflows/xcodebuild-or-fastlane.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 42d4d0d..b918b8f 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -75,15 +75,6 @@ jobs: xcodebuild -version swift --version echo "env.selfhosted: ${{ env.selfhosted }}" - echo "inputs.path: ${{ inputs.path }}" - echo "inputs.runsonlabels: ${{ inputs.runsonlabels }}" - echo "inputs.scheme: ${{ inputs.scheme }}" - echo "inputs.fastlanelane: ${{ inputs.fastlanelane }}" - echo "inputs.customcommand: ${{ inputs.customcommand }}" - echo "inputs.artifactname: ${{ inputs.artifactname }}" - echo "inputs.setupsigning: ${{ inputs.setupsigning }}" - echo "inputs.cacheDerivedData: ${{ inputs.cacheDerivedData }}" - echo "inputs.setupfirebaseemulator: ${{ inputs.setupfirebaseemulator }}" - name: Install xcpretty if: "!env.selfhosted && inputs.scheme != ''" run: gem install xcpretty