Skip to content

Commit 1542a7e

Browse files
jhamptonclaude
andauthored
chore(ci): YPE-1027 swift cocoa pods publishing may not publish the correct version automatically (#39)
* chore(ci): fix code coverage commit timing and version publishing, add build verification now builds in CI as sanity test, cocoapod publishing remains disabled, version update now functional. * chore(ci): update path for version script * chore(ci): use macos-26 runner and latest iOS simulator for reliable CI builds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(ci): update xcode version to a latest-stable to test whether this works in GH as advertised --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ee02e25 commit 1542a7e

File tree

5 files changed

+89
-29
lines changed

5 files changed

+89
-29
lines changed

.github/workflows/coverage.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,35 @@ on:
99
- main
1010

1111
env:
12-
XCODE_VERSION: 26.0.1
12+
XCODE_VERSION: latest-stable
1313
IOS_SIMULATOR_NAME: iPhone 17
14-
IOS_SIMULATOR_OS: 26.1
14+
IOS_SIMULATOR_OS: latest
1515

1616
permissions:
1717
contents: write
1818

1919
jobs:
2020
coverage:
21-
runs-on: macos-latest
21+
runs-on: macos-26
2222
steps:
2323
- uses: actions/checkout@v4
2424
with:
25+
ref: main
2526
ssh-key: ${{ secrets.RELEASE_SSH_KEY }}
2627

2728
- uses: maxim-lobanov/setup-xcode@v1
2829
with:
2930
xcode-version: ${{ env.XCODE_VERSION }}
3031

32+
- name: Ensure iOS Simulator runtime is available
33+
run: |
34+
if ! xcrun simctl list runtimes | grep -q "iOS.*26"; then
35+
echo "iOS 26 runtime not found. Downloading..."
36+
xcodebuild -downloadPlatform iOS
37+
else
38+
echo "iOS 26 runtime is already installed."
39+
fi
40+
3141
- name: Run tests with code coverage
3242
run: |
3343
xcodebuild \
@@ -95,6 +105,7 @@ jobs:
95105
run: |
96106
git config user.name "github-actions[bot]"
97107
git config user.email "github-actions[bot]@users.noreply.github.com"
108+
git pull --rebase origin main
98109
git add .github/badges/coverage.json
99110
git diff --staged --quiet || git commit -m "chore: update coverage badge [skip ci]"
100111
git push

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,46 @@ on:
55
branches:
66
- main
77

8+
env:
9+
XCODE_VERSION: latest-stable
10+
IOS_SIMULATOR_NAME: iPhone 17
11+
IOS_SIMULATOR_OS: latest
12+
813
permissions:
914
contents: write
1015
issues: write
1116
pull-requests: write
1217

1318
jobs:
19+
test:
20+
runs-on: macos-26
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: maxim-lobanov/setup-xcode@v1
25+
with:
26+
xcode-version: ${{ env.XCODE_VERSION }}
27+
28+
- name: Ensure iOS Simulator runtime is available
29+
run: |
30+
if ! xcrun simctl list runtimes | grep -q "iOS.*26"; then
31+
echo "iOS 26 runtime not found. Downloading..."
32+
xcodebuild -downloadPlatform iOS
33+
else
34+
echo "iOS 26 runtime is already installed."
35+
fi
36+
37+
- name: Run tests
38+
run: |
39+
xcodebuild \
40+
-scheme YouVersionPlatform \
41+
-destination 'platform=iOS Simulator,name=${{ env.IOS_SIMULATOR_NAME }},OS=${{ env.IOS_SIMULATOR_OS }}' \
42+
-derivedDataPath DerivedData \
43+
-enableCodeCoverage NO \
44+
test
45+
1446
release:
47+
needs: test
1548
runs-on: macos-latest
1649

1750
steps:

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,33 @@ name: Unit Tests
33
on: [pull_request]
44

55
env:
6-
XCODE_VERSION: 26.0.1
6+
XCODE_VERSION: latest-stable
77
IOS_SIMULATOR_NAME: iPhone 17
8-
IOS_SIMULATOR_OS: 26.1
8+
IOS_SIMULATOR_OS: latest
99

1010
permissions:
1111
contents: read
1212
pull-requests: write
1313

1414
jobs:
1515
test:
16-
runs-on: macos-latest
16+
runs-on: macos-26
1717
steps:
1818
- uses: actions/checkout@v4
1919

2020
- uses: maxim-lobanov/setup-xcode@v1
2121
with:
2222
xcode-version: ${{ env.XCODE_VERSION }}
2323

24+
- name: Ensure iOS Simulator runtime is available
25+
run: |
26+
if ! xcrun simctl list runtimes | grep -q "iOS.*26"; then
27+
echo "iOS 26 runtime not found. Downloading..."
28+
xcodebuild -downloadPlatform iOS
29+
else
30+
echo "iOS 26 runtime is already installed."
31+
fi
32+
2433
- name: Display Swift and Xcode versions and available simulators
2534
run: |
2635
swift --version

scripts/publish-pods.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,32 @@ echo "Publishing version $VERSION to CocoaPods trunk..."
1212
echo "IMPORTANT: Pods will be published in dependency order"
1313

1414
# Publish in dependency order: Core -> UI -> Reader -> Platform
15+
#
16+
# To enable CocoaPods publishing, uncomment the `pod trunk push` lines below.
17+
# A delay between each push allows the CocoaPods CDN to index the previous pod
18+
# before a dependent pod is pushed.
19+
1520
echo ""
1621
echo "Step 1/4: Publishing YouVersionPlatformCore..."
17-
# Uncomment the following line to publish the podspec
18-
#pod trunk push YouVersionPlatformCore.podspec --allow-warnings --synchronous
22+
pod trunk push YouVersionPlatformCore.podspec --allow-warnings --synchronous
23+
#echo "Waiting for CDN propagation..."
24+
#sleep 60
1925

2026
echo ""
2127
echo "Step 2/4: Publishing YouVersionPlatformUI..."
22-
# Uncomment the following line to publish the podspec
23-
#pod trunk push YouVersionPlatformUI.podspec --allow-warnings --synchronous
28+
pod trunk push YouVersionPlatformUI.podspec --allow-warnings --synchronous
29+
#echo "Waiting for CDN propagation..."
30+
#sleep 60
2431

2532
echo ""
2633
echo "Step 3/4: Publishing YouVersionPlatformReader..."
27-
# Uncomment the following line to publish the podspec
28-
#pod trunk push YouVersionPlatformReader.podspec --allow-warnings --synchronous
34+
pod trunk push YouVersionPlatformReader.podspec --allow-warnings --synchronous
35+
#echo "Waiting for CDN propagation..."
36+
#sleep 60
2937

3038
echo ""
31-
echo "Step 4/4: Publishing YouVersionPlatform (Dry-Run)..."
32-
# Uncomment the following line to publish the podspec
33-
#pod trunk push YouVersionPlatform.podspec --allow-warnings --synchronous
39+
echo "Step 4/4: Publishing YouVersionPlatform..."
40+
pod trunk push YouVersionPlatform.podspec --allow-warnings --synchronous
3441

3542
echo ""
36-
echo "✅ All pods published successfully for version $VERSION!"
37-
echo ""
38-
echo "Verifying publication..."
39-
pod search YouVersionPlatform --simple | head -n 5
43+
echo "✅ Pod version $VERSION was pushed to trunk."

scripts/update-pod-versions.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -e
33

4+
# Change to repository root directory (parent of scripts/)
5+
cd "$(dirname "$0")/.."
6+
47
VERSION=$1
58

69
if [ -z "$VERSION" ]; then
@@ -10,21 +13,21 @@ fi
1013

1114
echo "Updating version to $VERSION in all podspec files..."
1215

13-
# Update each podspec file
16+
# Update s.version in each podspec file.
17+
# Inter-pod dependencies use s.version.to_s, so they automatically stay in sync.
1418
sed -i '' "s/s\.version[[:space:]]*=.*/s.version = '$VERSION'/" YouVersionPlatform.podspec
1519
sed -i '' "s/s\.version[[:space:]]*=.*/s.version = '$VERSION'/" YouVersionPlatformCore.podspec
1620
sed -i '' "s/s\.version[[:space:]]*=.*/s.version = '$VERSION'/" YouVersionPlatformReader.podspec
1721
sed -i '' "s/s\.version[[:space:]]*=.*/s.version = '$VERSION'/" YouVersionPlatformUI.podspec
1822

19-
echo "Updating inter-pod dependency versions..."
20-
21-
# Update dependency versions within podspecs
22-
sed -i '' "s/dependency 'YouVersionPlatformCore', '[^']*'/dependency 'YouVersionPlatformCore', '$VERSION'/" YouVersionPlatform.podspec
23-
sed -i '' "s/dependency 'YouVersionPlatformCore', '[^']*'/dependency 'YouVersionPlatformCore', '$VERSION'/" YouVersionPlatformUI.podspec
24-
sed -i '' "s/dependency 'YouVersionPlatformCore', '[^']*'/dependency 'YouVersionPlatformCore', '$VERSION'/" YouVersionPlatformReader.podspec
25-
sed -i '' "s/dependency 'YouVersionPlatformUI', '[^']*'/dependency 'YouVersionPlatformUI', '$VERSION'/" YouVersionPlatformReader.podspec
26-
sed -i '' "s/dependency 'YouVersionPlatformUI', '[^']*'/dependency 'YouVersionPlatformUI', '$VERSION'/" YouVersionPlatform.podspec
27-
sed -i '' "s/dependency 'YouVersionPlatformReader', '[^']*'/dependency 'YouVersionPlatformReader', '$VERSION'/" YouVersionPlatform.podspec
23+
echo "Verifying version was updated..."
24+
for PODSPEC in YouVersionPlatform.podspec YouVersionPlatformCore.podspec YouVersionPlatformReader.podspec YouVersionPlatformUI.podspec; do
25+
if ! grep -q "s.version = '$VERSION'" "$PODSPEC"; then
26+
echo "Error: Failed to update version in $PODSPEC"
27+
exit 1
28+
fi
29+
echo "$PODSPEC"
30+
done
2831

2932
echo "Validating podspecs..."
3033

0 commit comments

Comments
 (0)