Skip to content

Commit

Permalink
Avoid code signing when checking that the demo compiles (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos authored Feb 14, 2025
1 parent 8a97eea commit 5dc5689
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
check_name: 📋 Unit test report (${{ matrix.platform }})
fail_on_failure: true

archive-demos:
name: 📦 Archives
build-demos:
name: 🔨 Builds
runs-on: macos-latest
strategy:
matrix:
Expand All @@ -49,23 +49,5 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Add Apple certificate
run: |
Scripts/private/add-apple-certificate.sh \
$RUNNER_TEMP \
${{ secrets.KEYCHAIN_PASSWORD }} \
${{ secrets.APPLE_DEV_CERTIFICATE }} \
${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }}
- name: Configure environment
run: |
Scripts/private/configure-environment.sh \
${{ secrets.APP_STORE_CONNECT_API_KEY }}
- name: Archive the demo
run: Scripts/private/archive-demo.sh -p ${{ matrix.platform }}
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }}
TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }}
- name: Build the demo
run: make build-${{ matrix.platform }}
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ test-streams-start:
test-streams-stop:
@Scripts/public/test-streams.sh -k

.PHONY: build-ios
build-ios:
@Scripts/public/build-demo.sh -p ios

.PHONY: build-tvos
build-tvos:
@Scripts/public/build-demo.sh -p tvos

.PHONY: test-ios
test-ios:
@Scripts/public/test-streams.sh -s
Expand Down Expand Up @@ -54,11 +62,15 @@ help:
@echo "Default:"
@echo " all Default target"
@echo
@echo "Test:"
@echo "Builds:"
@echo " build-ios Build iOS demo app"
@echo " build-tvos Build tvOS demo app"
@echo
@echo "Tests:"
@echo " test-streams-start Start test streams"
@echo " test-streams-stop Stop test streams"
@echo " test-ios Build & run iOS unit tests"
@echo " test-tvos Build & run tvOS unit tests"
@echo " test-ios Build and run iOS unit tests"
@echo " test-tvos Build and run tvOS unit tests"
@echo
@echo "Quality:"
@echo " check-quality Run quality checks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fi

install_tools

echo -e "Archiving $PLATFORM demo..."
echo -e "Building $PLATFORM demo..."
bundle config set path '.bundle'
bundle install
bundle exec fastlane "archive_demo_$PLATFORM"
echo "... done."
bundle exec fastlane "build_demo_$PLATFORM"
echo "... done."
37 changes: 24 additions & 13 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,19 @@ def bump_testflight_build_number(platform_id, configuration_id)
build_number
end

def build_and_sign_app(platform_id, configuration_id)
def build_demo_app(platform_id, configuration_id)
build_app(
project: 'Demo/Pillarbox-demo.xcodeproj',
configuration: CONFIGURATIONS[configuration_id],
scheme: 'Pillarbox-demo',
destination: "generic/platform=#{PLATFORMS[platform_id]}",
output_directory: 'Binaries',
skip_archive: true,
skip_codesigning: true
)
end

def build_and_sign_demo_app(platform_id, configuration_id)
build_app(
project: 'Demo/Pillarbox-demo.xcodeproj',
configuration: CONFIGURATIONS[configuration_id],
Expand Down Expand Up @@ -141,17 +153,16 @@ rescue StandardError => e
UI.important('TestFlight external delivery was skipped because a build is already in review')
end

def archive_demo(platform_id)
ensure_configuration_availability
build_and_sign_app(platform_id, :nightly)
build_and_sign_app(platform_id, :release)
def build_demo(platform_id)
build_demo_app(platform_id, :nightly)
build_demo_app(platform_id, :release)
end

def deliver_demo_nightly(platform_id)
ensure_configuration_availability
build_number = bump_testflight_build_number(platform_id, :nightly)
add_version_badge(platform_id, last_git_tag, build_number, 'orange')
build_and_sign_app(platform_id, :nightly)
build_and_sign_demo_app(platform_id, :nightly)
reset_git_repo(skip_clean: true)
upload_app_to_testflight
distribute_app_to_testers(platform_id, :nightly, build_number)
Expand All @@ -161,7 +172,7 @@ def deliver_demo_release(platform_id)
ensure_configuration_availability
build_number = bump_testflight_build_number(platform_id, :release)
add_version_badge(platform_id, 'v.', last_git_tag, 'blue')
build_and_sign_app(platform_id, :release)
build_and_sign_demo_app(platform_id, :release)
reset_git_repo(skip_clean: true)
upload_app_to_testflight
distribute_app_to_testers(platform_id, :release, build_number)
Expand Down Expand Up @@ -203,14 +214,14 @@ platform :ios do
reset_git_repo(skip_clean: true)
end

desc 'Archive the iOS demo app'
lane :archive_demo_ios do
archive_demo(:ios)
desc 'Build the iOS demo app'
lane :build_demo_ios do
build_demo(:ios)
end

desc 'Archive the tvOS demo app'
lane :archive_demo_tvos do
archive_demo(:tvos)
desc 'Build the tvOS demo app'
lane :build_demo_tvos do
build_demo(:tvos)
end

desc 'Deliver an iOS demo app nightly build'
Expand Down

0 comments on commit 5dc5689

Please sign in to comment.