Skip to content

Commit 5866f82

Browse files
authored
chore: updating Github action workflows
1 parent 2e22a2d commit 5866f82

File tree

15 files changed

+231
-49
lines changed

15 files changed

+231
-49
lines changed

.github/composite_actions/get_platform_parameters/action.yml

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
required: true
66
type: string
77
xcode_version:
8-
description: "The version of Xcode. Available aliases are 'latest' and 'minimum'"
8+
description: "The version of Xcode. Available aliases are 'latest', 'minimum', and 'beta'"
99
default: 'latest'
1010
type: string
1111
destination:
@@ -41,8 +41,9 @@ runs:
4141

4242
- id: get-xcode-version
4343
run: |
44-
LATEST_XCODE_VERSION=16.2.0
45-
MINIMUM_XCODE_VERSION=16.1.0
44+
LATEST_XCODE_VERSION=16.4.0
45+
MINIMUM_XCODE_VERSION=16.0.0
46+
DEFAULT_BETA_XCODE_VERSION=26.0_beta
4647
4748
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
4849
@@ -51,6 +52,17 @@ runs:
5152
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
5253
minimum)
5354
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
55+
beta)
56+
# Try to auto-detect installed Xcode 26 beta app name
57+
DETECTED=$(ls -1 /Applications 2>/dev/null | grep -E '^Xcode_26.*\.app$' | head -n1 || true)
58+
if [ -n "$DETECTED" ]; then
59+
# strip prefix and suffix to get the version token used in the path template
60+
# e.g., Xcode_26.0_beta.app -> 26.0_beta
61+
XCODE_VERSION=$(echo "$DETECTED" | sed -E 's/^Xcode_//; s/\.app$//')
62+
else
63+
XCODE_VERSION=$DEFAULT_BETA_XCODE_VERSION
64+
fi
65+
;;
5466
*)
5567
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
5668
esac
@@ -66,36 +78,68 @@ runs:
6678
6779
case $INPUT_PLATFORM/$INPUT_XCODE_VERSION in
6880
iOS/latest)
81+
DEVICE="iPhone 16 Pro Max"
82+
OS_VERSION="18.5"
83+
;;
84+
iOS/beta)
6985
DEVICE="iPhone 16"
70-
OS_VERSION="18.2"
86+
OS_VERSION="26.0"
87+
;;
88+
iOS/minimum)
89+
DEVICE="iPhone 16 Pro Max"
90+
OS_VERSION="18.0"
7191
;;
7292
iOS/*)
73-
DEVICE="iPhone 15"
74-
OS_VERSION="17.0.1"
93+
DEVICE="iPhone 16 Pro Max"
94+
OS_VERSION="18.5"
7595
;;
7696
tvOS/latest)
7797
DEVICE="Apple TV 4K (3rd generation)"
78-
OS_VERSION="18.2"
98+
OS_VERSION="18.5"
99+
;;
100+
tvOS/beta)
101+
DEVICE="Apple TV 4K (3rd generation)"
102+
OS_VERSION="26.0"
103+
;;
104+
tvOS/minimum)
105+
DEVICE="Apple TV 4K (3rd generation)"
106+
OS_VERSION="18.0"
79107
;;
80108
tvOS/*)
81109
DEVICE="Apple TV 4K (3rd generation)"
82-
OS_VERSION="17.0"
110+
OS_VERSION="18.5"
83111
;;
84112
watchOS/latest)
85113
DEVICE="Apple Watch Series 10 (46mm)"
86-
OS_VERSION="11.2"
114+
OS_VERSION="11.5"
115+
;;
116+
watchOS/beta)
117+
DEVICE="Apple Watch Series 10 (46mm)"
118+
OS_VERSION="26.0"
119+
;;
120+
watchOS/minimum)
121+
DEVICE="Apple Watch SE (44mm) (2nd generation)"
122+
OS_VERSION="11.0"
87123
;;
88124
watchOS/*)
89-
DEVICE="Apple Watch Series 7 (45mm)"
90-
OS_VERSION="10.0"
125+
DEVICE="iPhone 16 Pro Max"
126+
OS_VERSION="18.5"
91127
;;
92128
visionOS/latest)
93129
DEVICE="Apple Vision Pro"
94-
OS_VERSION="2.2"
130+
OS_VERSION="2.5"
131+
;;
132+
visionOS/beta)
133+
DEVICE="Apple Vision Pro"
134+
OS_VERSION="26.0"
135+
;;
136+
visionOS/minimum)
137+
DEVICE="Apple Vision Pro"
138+
OS_VERSION="2.0"
95139
;;
96140
visionOS/*)
97141
DEVICE="Apple Vision Pro"
98-
OS_VERSION="1.0"
142+
OS_VERSION="2.5"
99143
;;
100144
esac
101145
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'Install Simulators if Needed'
2+
description: 'Downloads and installs simulator runtimes for Xcode 16.0'
3+
4+
inputs:
5+
xcode_version:
6+
description: 'The Xcode version being used'
7+
required: true
8+
type: string
9+
platform:
10+
description: 'The platform to install simulators for'
11+
required: true
12+
type: string
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Install Simulators for Xcode 16.0
18+
shell: bash
19+
run: |
20+
XCODE_VERSION="${{ inputs.xcode_version }}"
21+
PLATFORM="${{ inputs.platform }}"
22+
23+
# Only run for Xcode 16.0.0
24+
if [[ "$XCODE_VERSION" != "16.0.0" ]]; then
25+
echo "Not Xcode 16.0.0 (current: $XCODE_VERSION), skipping simulator installation"
26+
exit 0
27+
fi
28+
29+
# Skip for macOS as it doesn't need simulators
30+
if [[ "$PLATFORM" == "macOS" ]]; then
31+
echo "macOS doesn't need simulator downloads"
32+
exit 0
33+
fi
34+
35+
echo "Installing simulators for $PLATFORM with Xcode 16.0.0..."
36+
37+
# Show what's available before download
38+
echo "Simulators before download:"
39+
xcrun simctl list runtimes || true
40+
41+
# Download the platform - this will get the appropriate version for Xcode 16.0
42+
echo "Downloading $PLATFORM platform for Xcode 16.0..."
43+
case $PLATFORM in
44+
iOS)
45+
sudo xcodebuild -downloadPlatform iOS || echo "Failed to download iOS platform"
46+
;;
47+
tvOS)
48+
sudo xcodebuild -downloadPlatform tvOS || echo "Failed to download tvOS platform"
49+
;;
50+
watchOS)
51+
sudo xcodebuild -downloadPlatform watchOS || echo "Failed to download watchOS platform"
52+
;;
53+
visionOS)
54+
sudo xcodebuild -downloadPlatform visionOS || echo "Failed to download visionOS platform"
55+
;;
56+
esac
57+
58+
# Show what's available after download
59+
echo "Simulators after download:"
60+
xcrun simctl list runtimes || true

.github/workflows/api-breaking-changes-detection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
jobs:
1111
build-and-check-api-breakage:
1212
name: Build and Check API Breakage
13-
runs-on: macos-latest
13+
runs-on: macos-15
1414

1515
steps:
1616
- name: Checkout repository

.github/workflows/api_digester_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
check-swift-api-digester:
10-
runs-on: macos-latest
10+
runs-on: macos-15
1111

1212
steps:
1313
- name: Checkout repository

.github/workflows/build_minimum_supported_swift_platforms.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: ./.github/workflows/build_scheme.yml
2828
with:
2929
scheme: Amplify-Build
30-
os-runner: 'macos-latest'
30+
os-runner: 'macos-15'
3131
xcode-version: 'minimum'
3232
platform: ${{ matrix.platform }}
3333
save_build_cache: false

.github/workflows/build_scheme.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
platform: ${{ inputs.platform }}
4444
xcode_version: ${{ inputs.xcode-version }}
4545

46+
- name: Install simulators if needed
47+
uses: ./.github/composite_actions/install_simulators_if_needed
48+
with:
49+
xcode_version: ${{ steps.platform.outputs.xcode-version }}
50+
platform: ${{ inputs.platform }}
51+
4652
- name: Attempt to use the dependencies cache
4753
id: dependencies-cache
4854
timeout-minutes: 4
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build with Xcode Beta | Amplify Swift
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: read
14+
actions: write
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: ${{ github.ref_name != 'main' }}
19+
20+
jobs:
21+
build-amplify-with-xcode-beta:
22+
name: Build Amplify Swift for ${{ matrix.platform }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
platform: [macOS]
27+
28+
uses: ./.github/workflows/build_scheme.yml
29+
with:
30+
scheme: Amplify-Build
31+
os-runner: 'macos-15'
32+
xcode-version: 'beta'
33+
platform: ${{ matrix.platform }}
34+
save_build_cache: false
35+
36+
confirm-pass:
37+
runs-on: ubuntu-latest
38+
name: Confirm Passing Build Steps
39+
if: ${{ !cancelled() }}
40+
needs: [build-amplify-with-xcode-beta]
41+
env:
42+
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
43+
steps:
44+
- run: exit $EXIT_CODE

.github/workflows/canary.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Canary Test
22

33
on:
4+
workflow_dispatch:
45
schedule:
56
- cron: '0 16 * * *' # Everyday 16:00 UTC
67

@@ -15,14 +16,14 @@ jobs:
1516
strategy:
1617
matrix:
1718
include:
18-
- os: macos-latest
19-
xcode-version: 15.3.0
20-
device: iPhone 15
21-
version: 17.4
22-
- os: macos-latest
23-
xcode-version: 15.0.1
24-
device: iPhone 14
25-
version: 17.0.1
19+
- os: macos-15
20+
xcode-version: '16.4.0'
21+
device: 'iPhone 16 Pro Max'
22+
version: '18.5'
23+
- os: macos-15
24+
xcode-version: '16.0.0'
25+
device: 'iPhone 16 Pro Max'
26+
version: '18.0'
2627
name: Canary Test - Xcode ${{ matrix.xcode-version }}
2728
runs-on: ${{ matrix.os }}
2829
steps:
@@ -50,6 +51,12 @@ jobs:
5051
sudo xcode-select -s "/Applications/Xcode_${{ matrix.xcode-version }}.app"
5152
xcodebuild -version
5253
54+
- name: Install simulators if needed
55+
uses: ./.github/composite_actions/install_simulators_if_needed
56+
with:
57+
xcode_version: ${{ matrix.xcode-version }}
58+
platform: iOS
59+
5360
- name: Run Tests - ${{ matrix.device }} with iOS ${{ matrix.version }}
5461
working-directory: ${{ github.workspace }}/canaries/example
5562
run: bundle exec fastlane scan --device "${{ matrix.device }}" --deployment_target_version "${{ matrix.version }}"

.github/workflows/release_kickoff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
jobs:
1111
release:
1212
name: Release
13-
runs-on: macos-latest
13+
runs-on: ubuntu-latest
1414

1515
steps:
1616
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer/index.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ app.post("/notifications", async (req, res) => {
4646
data: data ?? {}
4747
}
4848
try {
49-
const cmd = `echo '${JSON.stringify(apns)}' | xcrun simctl --set testing push ${deviceId} ${bundleId} -`
49+
const cmd = `echo '${JSON.stringify(apns)}' | xcrun simctl push ${deviceId} ${bundleId} -`
5050
await run(cmd)
5151
res.send("Done")
5252
} catch (error) {
@@ -60,7 +60,7 @@ app.post('/uninstall', async (req, res) => {
6060
console.log("POST /uninstall ")
6161
const { deviceId } = req.body
6262
try {
63-
const cmd = `xcrun simctl --set testing uninstall ${deviceId} ${bundleId}`
63+
const cmd = `xcrun simctl uninstall ${deviceId} ${bundleId}`
6464
await run(cmd)
6565
res.send("Done")
6666
} catch (error) {
@@ -73,7 +73,7 @@ app.post('/boot', async (req, res) => {
7373
console.log("POST /boot ")
7474
const { deviceId } = req.body
7575
try {
76-
const cmd = `xcrun simctl --set testing bootstatus ${deviceId} -b`
76+
const cmd = `xcrun simctl bootstatus ${deviceId} -b`
7777
await run(cmd)
7878
res.send("Done")
7979
} catch (error) {
@@ -84,4 +84,4 @@ app.post('/boot', async (req, res) => {
8484

8585
app.listen(9293, () => {
8686
console.log("Starting server")
87-
})
87+
})

0 commit comments

Comments
 (0)