-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (66 loc) · 2.47 KB
/
build-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build Sample App
on:
workflow_dispatch:
inputs:
smile_config:
description: 'The contents of the smile_config.json file (default: Partner 002)'
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
# TODO: Change back to macos-latest once it points to macOS 14 (Q2 '24)
runs-on: macos-14
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup environment
run: bundle install
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.2
- name: Write Smile Config
id: write_smile_config
# Mask the config so that it doesn't show up in the logs
run: |
INPUT_SMILE_CONFIG=$(jq -r '.inputs.smile_config // empty' $GITHUB_EVENT_PATH)
echo "::add-mask::$INPUT_SMILE_CONFIG"
if [ -n "$INPUT_SMILE_CONFIG" ]; then
SMILE_CONFIG="$INPUT_SMILE_CONFIG"
else
SMILE_CONFIG="$SMILE_CONFIG_PARTNER_002"
fi
echo "$SMILE_CONFIG" > smile_config.json
PARTNER_ID=$(jq -r '.partner_id' smile_config.json)
echo "partner_id=$PARTNER_ID" >> $GITHUB_OUTPUT
env:
SMILE_CONFIG_PARTNER_002: ${{ secrets.SMILE_CONFIG_PARTNER_002 }}
- name: Add Smile Config to Xcode Project
run: ruby add_smile_config.rb
- name: Build and Deploy to TestFlight 🚀
run: |
cd example
bundle exec fastlane releaseapp
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.PAT_IOS_CERTIFICATES_REPO_B64 }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
ISSUER_ID: ${{ secrets.ISSUER_ID }}
KEY_ID: ${{ secrets.KEY_ID }}
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 10
- name: Send Slack Notification
uses: slackapi/[email protected]
with:
payload: |
{
"partner_id": "${{ steps.write_smile_config.outputs.partner_id }}",
"branch": "${{ github.ref }}",
"commit_sha": "${{ github.sha }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL}}