Skip to content

Commit 239c10e

Browse files
committed
peg to older xcode to speed things up
1 parent 1157cbc commit 239c10e

File tree

1 file changed

+33
-85
lines changed

1 file changed

+33
-85
lines changed

.github/workflows/build-release.yaml

+33-85
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ on:
99
jobs:
1010
test:
1111
name: Build and test
12-
runs-on: macos-latest
12+
runs-on: macos-13
1313
environment:
1414
name: Test
1515
steps:
16+
# Older xcode used to avoid timeouts in fastlane that were introduced by Xcode 15...
17+
# https://github.com/orgs/community/discussions/68807
18+
- uses: maxim-lobanov/setup-xcode@v1
19+
with:
20+
xcode-version: '14.3.1'
21+
1622
- name: Checkout
17-
uses: actions/checkout@v3
18-
- name: Install tools
19-
run: |
20-
brew install sunshinejr/formulae/pouch
23+
uses: actions/checkout@v4
24+
25+
- name: Install Pouch
26+
run: brew install sunshinejr/formulae/pouch
27+
2128
- name: Generate Secrets.swift
2229
env:
2330
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
@@ -30,6 +37,7 @@ jobs:
3037
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
3138
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
3239
run: pouch
40+
3341
- name: Build and test
3442
env:
3543
platform: ${{ 'iOS Simulator' }}
@@ -39,91 +47,26 @@ jobs:
3947
set -o pipefail
4048
xcodebuild build-for-testing test -scheme "Unit Tests" -project "Tree Tracker.xcodeproj" -destination "platform=$platform,name=$device" | xcpretty
4149
42-
build-publish-stage:
43-
name: Build and publish - Stage
44-
if: ${{ false }}
45-
runs-on: macos-latest
46-
needs: build-publish-prod
47-
environment:
48-
name: Stage
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v3
52-
- name: Install tools
53-
run: |
54-
brew install sunshinejr/formulae/pouch
55-
- name: Generate Secrets.swift
56-
env:
57-
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
58-
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
59-
AWS_BUCKET_NAME: ${{ vars.AWS_BUCKET_NAME }}
60-
AWS_BUCKET_REGION: ${{ vars.AWS_BUCKET_REGION }}
61-
AWS_BUCKET_PREFIX: ${{ vars.AWS_BUCKET_PREFIX }}
62-
PROTECT_EARTH_API_TOKEN: ${{ secrets.PROTECT_EARTH_API_TOKEN }}
63-
PROTECT_EARTH_API_BASE_URL: ${{ secrets.PROTECT_EARTH_API_BASE_URL }}
64-
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
65-
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
66-
run: pouch
67-
- name: Set build number
68-
run: agvtool new-version $GITHUB_RUN_NUMBER.1
69-
- name: Configure Keychain
70-
env:
71-
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
72-
BUILD_CERTIFICATE_BASE64: ${{ secrets.DISTRIBUTION_CERT_BASE64 }}
73-
P12_PASSWORD: ${{ secrets.DISTRIBUTION_CERT_PASSWORD }}
74-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
75-
run: |
76-
# create variables
77-
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
78-
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
79-
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
80-
81-
# import certificate and provisioning profile from secrets
82-
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
83-
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
84-
85-
# create temporary keychain
86-
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
87-
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
88-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
89-
90-
# import certificate to keychain
91-
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
92-
security list-keychain -d user -s $KEYCHAIN_PATH
93-
94-
# apply provisioning profile
95-
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
96-
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
97-
- name: Build archive
98-
run: |
99-
set -o pipefail
100-
mkdir -p ~/build
101-
xcodebuild clean archive -scheme "Tree Tracker" -project "Tree Tracker.xcodeproj" -sdk iphoneos -configuration Release -archivePath ~/build/Tree\ Tracker.xcarchive | xcpretty
102-
- name: Export .ipa
103-
run: |
104-
set -o pipefail
105-
xcodebuild -archivePath ~/build/Tree\ Tracker.xcarchive -exportOptionsPlist $GITHUB_WORKSPACE/Tree\ Tracker/ExportOptions.plist -exportPath ~/build -allowProvisioningUpdates -exportArchive | xcpretty
106-
- name: Publish
107-
if: ${{ success() && github.ref_name == 'main' && github.event_name != 'pull_request' }}
108-
env:
109-
APPLEID_USERNAME: ${{ secrets.APPLE_APPLE_ID }}
110-
APPLEID_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
111-
run: |
112-
xcrun altool --upload-app -t ios -f ~/build/Tree\ Tracker.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose
113-
114-
build-publish-prod:
115-
name: Build and publish - Production
50+
build-publish:
51+
name: Build and Publish
11652
if: ${{ github.ref_name == 'main' && github.event_name != 'pull_request' }}
117-
runs-on: macos-latest
53+
runs-on: macos-13
11854
needs: test
11955
environment:
12056
name: Production
12157
steps:
58+
# Older xcode used to avoid timeouts in fastlane that were introduced by Xcode 15...
59+
# https://github.com/orgs/community/discussions/68807
60+
- uses: maxim-lobanov/setup-xcode@v1
61+
with:
62+
xcode-version: '14.3.1'
63+
12264
- name: Checkout
123-
uses: actions/checkout@v3
124-
- name: Install tools
125-
run: |
126-
brew install sunshinejr/formulae/pouch
65+
uses: actions/checkout@v4
66+
67+
- name: Install Pouch
68+
run: brew install sunshinejr/formulae/pouch
69+
12770
- name: Generate Secrets.swift
12871
env:
12972
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
@@ -136,8 +79,10 @@ jobs:
13679
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
13780
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
13881
run: pouch
82+
13983
- name: Set build number
14084
run: agvtool new-version $GITHUB_RUN_NUMBER
85+
14186
- name: Configure Keychain
14287
env:
14388
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
@@ -166,19 +111,22 @@ jobs:
166111
# apply provisioning profile
167112
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
168113
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
114+
169115
- name: Build archive
170116
run: |
171117
set -o pipefail
172118
mkdir -p ~/build
173119
xcodebuild clean archive -scheme "Tree Tracker" -project "Tree Tracker.xcodeproj" -sdk iphoneos -configuration Release -archivePath ~/build/Tree\ Tracker.xcarchive | xcpretty
120+
174121
- name: Export .ipa
175122
run: |
176123
set -o pipefail
177124
xcodebuild -archivePath ~/build/Tree\ Tracker.xcarchive -exportOptionsPlist $GITHUB_WORKSPACE/Tree\ Tracker/ExportOptions.plist -exportPath ~/build -allowProvisioningUpdates -exportArchive | xcpretty
125+
178126
- name: Publish
179127
if: ${{ success() && github.ref_name == 'main' && github.event_name != 'pull_request' }}
180128
env:
181129
APPLEID_USERNAME: ${{ secrets.APPLE_APPLE_ID }}
182130
APPLEID_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
183131
run: |
184-
xcrun altool --upload-app -t ios -f ~/build/Tree\ Tracker.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose
132+
xcrun altool --upload-app -t ios -f ~/build/Tree\ Tracker.ipa -u "$APPLEID_USERNAME" -p "$APPLEID_PASSWORD" --verbose

0 commit comments

Comments
 (0)