Skip to content

Commit 39e005e

Browse files
committed
fix(ci): 👷 fix watchos pipeline to make it generic
1 parent 50198a8 commit 39e005e

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/build-ios.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v2
2020
- name: Select iOS Simulator
21-
id: select_sim
2221
run: |
2322
SIMULATOR_ID=$(xcrun simctl list devices available | grep -m1 'iPhone' | awk -F '[()]' '{print $2}')
2423
echo "SIMULATOR_ID=$SIMULATOR_ID" >> $GITHUB_ENV

.github/workflows/build-watchos.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build watchOS
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- '*'
77
pull_request:
88
branches:
@@ -11,15 +11,42 @@ on:
1111
- cron: '0 16 15 * *'
1212

1313
jobs:
14-
build:
14+
build:
1515
name: Build watchOS
1616
runs-on: macos-15
17+
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v2
21+
22+
- name: Select watchOS Simulator
23+
run: |
24+
WATCH_SIMULATOR_ID=$(xcrun simctl list devices available | \
25+
grep "Apple Watch" | \
26+
grep "watchOS" | \
27+
head -n 1 | \
28+
awk -F '[()]' '{print $2}')
29+
echo "WATCH_SIMULATOR_ID=$WATCH_SIMULATOR_ID" >> $GITHUB_ENV
2030
- name: Build watchOS framework
2131
run: |
22-
set -o pipefail && xcodebuild -project ID3TagEditor.xcodeproj -scheme "ID3TagEditor watchOS" clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination "platform=watchOS Simulator,name=Apple Watch SE (40mm) (2nd generation),OS=11.2" -skipPackagePluginValidation | xcpretty
32+
set -o pipefail && \
33+
xcodebuild \
34+
-project ID3TagEditor.xcodeproj \
35+
-scheme "ID3TagEditor watchOS" \
36+
clean build \
37+
CODE_SIGN_IDENTITY="" \
38+
CODE_SIGNING_REQUIRED=NO \
39+
-destination "id=$WATCH_SIMULATOR_ID" \
40+
-skipPackagePluginValidation | xcpretty
2341
- name: Build watchOS Demo
2442
run: |
25-
set -o pipefail && xcodebuild -project Demo/Demo.xcodeproj -scheme "Demo watchOS" clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -destination "platform=watchOS Simulator,name=Apple Watch SE (40mm) (2nd generation),OS=11.2" -skipPackagePluginValidation | xcpretty
43+
set -o pipefail && \
44+
xcodebuild \
45+
-project Demo/Demo.xcodeproj \
46+
-scheme "Demo watchOS" \
47+
clean build \
48+
CODE_SIGN_IDENTITY="" \
49+
CODE_SIGNING_REQUIRED=NO \
50+
CODE_SIGNING_ALLOWED=NO \
51+
-destination "id=$WATCH_SIMULATOR_ID" \
52+
-skipPackagePluginValidation | xcpretty

0 commit comments

Comments
 (0)