diff --git a/.github/composite_actions/get_platform_parameters/action.yml b/.github/composite_actions/get_platform_parameters/action.yml index 35353e4c98..a5128db472 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,14 @@ 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 ;; + *) echo "Unsupported platform: $INPUT_PLATFORM"; exit 1 ;; + esac *) XCODE_VERSION=$INPUT_XCODE_VERSION ;; esac 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..0c41c9be89 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 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