Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: iOS Build & TestFlight

on:
pull_request:
branches: [universe]
paths:
- 'mobile/ios/**'
- 'mobile/fastlane/**'
- 'mobile/Gemfile'
- '.github/workflows/ios-build.yml'
push:
branches: [universe]
paths:
- 'mobile/ios/**'
- 'mobile/fastlane/**'
- 'mobile/Gemfile'
- '.github/workflows/ios-build.yml'
workflow_dispatch:

jobs:
test:
name: iOS tests
runs-on: macos-latest
defaults:
run:
working-directory: mobile

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Capacitor CLI toolchain
run: npm install --no-save --registry=https://registry.npmjs.org @capacitor/core@8.3.4 @capacitor/cli@8.3.4 @capacitor/ios@8.3.4 @capacitor/push-notifications@8.1.1 @capacitor/splash-screen@8.0.1 typescript@6.0.3

- run: npx cap sync ios

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: mobile

- run: bundle exec fastlane ios test

beta:
name: Build and upload to TestFlight
runs-on: macos-latest
needs: test
if: github.event_name != 'pull_request'
defaults:
run:
working-directory: mobile

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Capacitor CLI toolchain
run: npm install --no-save --registry=https://registry.npmjs.org @capacitor/core@8.3.4 @capacitor/cli@8.3.4 @capacitor/ios@8.3.4 @capacitor/push-notifications@8.1.1 @capacitor/splash-screen@8.0.1 typescript@6.0.3

- run: npx cap sync ios

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: mobile

- run: |
if [ -z "$APPLE_ID" ] || [ -z "$APPLE_TEAM_ID" ] || [ -z "$MATCH_PASSWORD" ] || [ -z "$MATCH_GIT_BASIC_AUTHORIZATION" ] || [ -z "$ASC_KEY_ID" ] || [ -z "$ASC_ISSUER_ID" ] || [ -z "$ASC_KEY_CONTENT" ]; then
echo "Missing TestFlight secrets; skipping beta upload."
exit 0
fi
bundle exec fastlane ios beta
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }}
5 changes: 5 additions & 0 deletions mobile/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

app_identifier("net.bawes.universe")
apple_id(ENV["APPLE_ID"])
team_id(ENV["APPLE_TEAM_ID"])
41 changes: 41 additions & 0 deletions mobile/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

platform :ios do
desc "Sync App Store certificates and provisioning profiles"
lane :certs do
match(type: "appstore", readonly: is_ci)
end

desc "Build a signed App Store IPA"
lane :build do
certs
increment_build_number(xcodeproj: "ios/App/App.xcodeproj")
build_app(
project: "ios/App/App.xcodeproj",
scheme: "App",
export_method: "app-store",
)
end

desc "Run the iOS test suite"
lane :test do
run_tests(
project: "ios/App/App.xcodeproj",
scheme: "App",
)
end

desc "Upload a build to TestFlight"
lane :beta do
api_key = app_store_connect_api_key(
key_id: ENV["ASC_KEY_ID"],
issuer_id: ENV["ASC_ISSUER_ID"],
key_content: ENV["ASC_KEY_CONTENT"],
)
build
upload_to_testflight(
api_key: api_key,
skip_waiting_for_build_processing: true,
)
end
end
13 changes: 13 additions & 0 deletions mobile/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
App/build
App/Pods
App/output
App/App/public
DerivedData
xcuserdata

# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins

# Generated Config files
App/App/capacitor.config.json
App/App/config.xml
Loading