From 4b0dd9f2b3cfed84cd838d6b0498003bd5073211 Mon Sep 17 00:00:00 2001 From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:51:30 -0400 Subject: [PATCH] chore: Adding workflow to build Amplify for minimum Xcode --- .../get_platform_parameters/action.yml | 13 ++++++++++--- .github/workflows/build_amplify_swift_platforms.yml | 3 ++- .../build_minimum_supported_swift_platforms.yml | 5 +++-- .../{build_amplify_swift.yml => build_scheme.yml} | 9 ++++++--- 4 files changed, 21 insertions(+), 9 deletions(-) rename .github/workflows/{build_amplify_swift.yml => build_scheme.yml} (94%) diff --git a/.github/composite_actions/get_platform_parameters/action.yml b/.github/composite_actions/get_platform_parameters/action.yml index 35353e4c98..7b0b6ecb66 100644 --- a/.github/composite_actions/get_platform_parameters/action.yml +++ b/.github/composite_actions/get_platform_parameters/action.yml @@ -39,7 +39,8 @@ runs: - id: get-xcode-version run: | LATEST_XCODE_VERSION=14.3.1 - MINIMUM_XCODE_VERSION=14.0.1 + MINIMUM_XCODE_VERSION_IOS_MAC=14.1.0 + MINIMUM_XCODE_VERSION_WATCH_TV=14.3.1 INPUT_XCODE_VERSION=${{ inputs.xcode_version }} @@ -47,7 +48,13 @@ runs: latest) XCODE_VERSION=$LATEST_XCODE_VERSION ;; minimum) - XCODE_VERSION=$MINIMUM_XCODE_VERSION ;; + INPUT_PLATFORM=${{ inputs.platform }} + case $INPUT_PLATFORM in + iOS|macOS) + XCODE_VERSION=$MINIMUM_XCODE_VERSION_IOS_MAC ;; + tvOS|watchOS) + XCODE_VERSION=$MINIMUM_XCODE_VERSION_WATCH_TV ;; + esac ;; *) XCODE_VERSION=$INPUT_XCODE_VERSION ;; esac @@ -63,7 +70,7 @@ runs: DESTINATION_MAPPING='{ "minimum": { - "iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.0", + "iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1", "tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.0", "watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.0", "macOS": "platform=macOS,arch=x86_64" diff --git a/.github/workflows/build_amplify_swift_platforms.yml b/.github/workflows/build_amplify_swift_platforms.yml index 54fc16d50e..99b8da7302 100644 --- a/.github/workflows/build_amplify_swift_platforms.yml +++ b/.github/workflows/build_amplify_swift_platforms.yml @@ -52,9 +52,10 @@ jobs: - platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }} - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} - uses: ./.github/workflows/build_amplify_swift.yml + uses: ./.github/workflows/build_scheme.yml with: platform: ${{ matrix.platform }} + scheme: Amplify-Package confirm-pass: runs-on: ubuntu-latest diff --git a/.github/workflows/build_minimum_supported_swift_platforms.yml b/.github/workflows/build_minimum_supported_swift_platforms.yml index 1b3c1cadfd..b536276a65 100644 --- a/.github/workflows/build_minimum_supported_swift_platforms.yml +++ b/.github/workflows/build_minimum_supported_swift_platforms.yml @@ -14,12 +14,13 @@ jobs: matrix: platform: [iOS, macOS, tvOS, watchOS] - uses: ./.github/workflows/build_amplify_swift.yml + uses: ./.github/workflows/build_scheme.yml with: - os-runner: macos-12 + os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }} xcode-version: 'minimum' platform: ${{ matrix.platform }} cacheable: false + scheme: Amplify confirm-pass: runs-on: ubuntu-latest diff --git a/.github/workflows/build_amplify_swift.yml b/.github/workflows/build_scheme.yml similarity index 94% rename from .github/workflows/build_amplify_swift.yml rename to .github/workflows/build_scheme.yml index 095edbcfab..64947147d7 100644 --- a/.github/workflows/build_amplify_swift.yml +++ b/.github/workflows/build_scheme.yml @@ -1,4 +1,4 @@ -name: Build Amplify-Package for the given platform +name: Build scheme for the given platform on: workflow_call: inputs: @@ -14,6 +14,9 @@ on: type: string default: 'macos-13' + scheme: + type: string + cacheable: type: boolean default: true @@ -24,7 +27,7 @@ permissions: jobs: build-amplify-swift: - name: Build Amplify-Package | ${{ inputs.platform }} + name: Build ${{ inputs.scheme }} | ${{ inputs.platform }} runs-on: ${{ inputs.os-runner }} steps: - name: Checkout repository @@ -66,7 +69,7 @@ jobs: continue-on-error: ${{ inputs.cacheable }} uses: ./.github/composite_actions/run_xcodebuild with: - scheme: Amplify-Package + scheme: ${{ inputs.scheme }} destination: ${{ steps.platform.outputs.destination }} sdk: ${{ steps.platform.outputs.sdk }} xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app