Skip to content

Commit 5dc5689

Browse files
authored
Avoid code signing when checking that the demo compiles (#1141)
1 parent 8a97eea commit 5dc5689

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
check_name: 📋 Unit test report (${{ matrix.platform }})
4040
fail_on_failure: true
4141

42-
archive-demos:
43-
name: 📦 Archives
42+
build-demos:
43+
name: 🔨 Builds
4444
runs-on: macos-latest
4545
strategy:
4646
matrix:
@@ -49,23 +49,5 @@ jobs:
4949
- name: Checkout code
5050
uses: actions/checkout@v4
5151

52-
- name: Add Apple certificate
53-
run: |
54-
Scripts/private/add-apple-certificate.sh \
55-
$RUNNER_TEMP \
56-
${{ secrets.KEYCHAIN_PASSWORD }} \
57-
${{ secrets.APPLE_DEV_CERTIFICATE }} \
58-
${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }}
59-
60-
- name: Configure environment
61-
run: |
62-
Scripts/private/configure-environment.sh \
63-
${{ secrets.APP_STORE_CONNECT_API_KEY }}
64-
65-
- name: Archive the demo
66-
run: Scripts/private/archive-demo.sh -p ${{ matrix.platform }}
67-
env:
68-
TEAM_ID: ${{ secrets.TEAM_ID }}
69-
KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
70-
KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }}
71-
TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }}
52+
- name: Build the demo
53+
run: make build-${{ matrix.platform }}

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ test-streams-start:
1111
test-streams-stop:
1212
@Scripts/public/test-streams.sh -k
1313

14+
.PHONY: build-ios
15+
build-ios:
16+
@Scripts/public/build-demo.sh -p ios
17+
18+
.PHONY: build-tvos
19+
build-tvos:
20+
@Scripts/public/build-demo.sh -p tvos
21+
1422
.PHONY: test-ios
1523
test-ios:
1624
@Scripts/public/test-streams.sh -s
@@ -54,11 +62,15 @@ help:
5462
@echo "Default:"
5563
@echo " all Default target"
5664
@echo
57-
@echo "Test:"
65+
@echo "Builds:"
66+
@echo " build-ios Build iOS demo app"
67+
@echo " build-tvos Build tvOS demo app"
68+
@echo
69+
@echo "Tests:"
5870
@echo " test-streams-start Start test streams"
5971
@echo " test-streams-stop Stop test streams"
60-
@echo " test-ios Build & run iOS unit tests"
61-
@echo " test-tvos Build & run tvOS unit tests"
72+
@echo " test-ios Build and run iOS unit tests"
73+
@echo " test-tvos Build and run tvOS unit tests"
6274
@echo
6375
@echo "Quality:"
6476
@echo " check-quality Run quality checks"

Scripts/private/archive-demo.sh renamed to Scripts/public/build-demo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fi
3737

3838
install_tools
3939

40-
echo -e "Archiving $PLATFORM demo..."
40+
echo -e "Building $PLATFORM demo..."
4141
bundle config set path '.bundle'
4242
bundle install
43-
bundle exec fastlane "archive_demo_$PLATFORM"
44-
echo "... done."
43+
bundle exec fastlane "build_demo_$PLATFORM"
44+
echo "... done."

fastlane/Fastfile

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,19 @@ def bump_testflight_build_number(platform_id, configuration_id)
8585
build_number
8686
end
8787

88-
def build_and_sign_app(platform_id, configuration_id)
88+
def build_demo_app(platform_id, configuration_id)
89+
build_app(
90+
project: 'Demo/Pillarbox-demo.xcodeproj',
91+
configuration: CONFIGURATIONS[configuration_id],
92+
scheme: 'Pillarbox-demo',
93+
destination: "generic/platform=#{PLATFORMS[platform_id]}",
94+
output_directory: 'Binaries',
95+
skip_archive: true,
96+
skip_codesigning: true
97+
)
98+
end
99+
100+
def build_and_sign_demo_app(platform_id, configuration_id)
89101
build_app(
90102
project: 'Demo/Pillarbox-demo.xcodeproj',
91103
configuration: CONFIGURATIONS[configuration_id],
@@ -141,17 +153,16 @@ rescue StandardError => e
141153
UI.important('TestFlight external delivery was skipped because a build is already in review')
142154
end
143155

144-
def archive_demo(platform_id)
145-
ensure_configuration_availability
146-
build_and_sign_app(platform_id, :nightly)
147-
build_and_sign_app(platform_id, :release)
156+
def build_demo(platform_id)
157+
build_demo_app(platform_id, :nightly)
158+
build_demo_app(platform_id, :release)
148159
end
149160

150161
def deliver_demo_nightly(platform_id)
151162
ensure_configuration_availability
152163
build_number = bump_testflight_build_number(platform_id, :nightly)
153164
add_version_badge(platform_id, last_git_tag, build_number, 'orange')
154-
build_and_sign_app(platform_id, :nightly)
165+
build_and_sign_demo_app(platform_id, :nightly)
155166
reset_git_repo(skip_clean: true)
156167
upload_app_to_testflight
157168
distribute_app_to_testers(platform_id, :nightly, build_number)
@@ -161,7 +172,7 @@ def deliver_demo_release(platform_id)
161172
ensure_configuration_availability
162173
build_number = bump_testflight_build_number(platform_id, :release)
163174
add_version_badge(platform_id, 'v.', last_git_tag, 'blue')
164-
build_and_sign_app(platform_id, :release)
175+
build_and_sign_demo_app(platform_id, :release)
165176
reset_git_repo(skip_clean: true)
166177
upload_app_to_testflight
167178
distribute_app_to_testers(platform_id, :release, build_number)
@@ -203,14 +214,14 @@ platform :ios do
203214
reset_git_repo(skip_clean: true)
204215
end
205216

206-
desc 'Archive the iOS demo app'
207-
lane :archive_demo_ios do
208-
archive_demo(:ios)
217+
desc 'Build the iOS demo app'
218+
lane :build_demo_ios do
219+
build_demo(:ios)
209220
end
210221

211-
desc 'Archive the tvOS demo app'
212-
lane :archive_demo_tvos do
213-
archive_demo(:tvos)
222+
desc 'Build the tvOS demo app'
223+
lane :build_demo_tvos do
224+
build_demo(:tvos)
214225
end
215226

216227
desc 'Deliver an iOS demo app nightly build'

0 commit comments

Comments
 (0)