Skip to content

Commit

Permalink
chore: Adding workflow to build Amplify for minimum Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas committed Apr 24, 2024
1 parent adf5a2e commit 6bbc685
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ 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 }}
case $INPUT_XCODE_VERSION in
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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_amplify_swift_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Amplify-Package for the given platform
name: Build scheme for the given platform
on:
workflow_call:
inputs:
Expand All @@ -14,6 +14,9 @@ on:
type: string
default: 'macos-13'

scheme:
type: string

cacheable:
type: boolean
default: true
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6bbc685

Please sign in to comment.