my fork of the bluesky client
1---
2name: Build and Submit iOS
3
4on:
5 workflow_dispatch:
6 inputs:
7 profile:
8 type: choice
9 description: Build profile to use
10 options:
11 - testflight
12 - production
13
14jobs:
15 build:
16 name: Build and Submit iOS
17 runs-on: macos-14
18 steps:
19 - name: Check for EXPO_TOKEN
20 run: >
21 if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
22 echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
23 exit 1
24 fi
25
26 - name: ⬇️ Checkout
27 uses: actions/checkout@v4
28 with:
29 fetch-depth: 5
30
31 - name: 🔧 Setup Node
32 uses: actions/setup-node@v4
33 with:
34 node-version-file: .nvmrc
35 cache: yarn
36
37 - name: 🪛 Setup jq
38 uses: dcarbone/install-jq-action@v2
39
40 - name: 🔨 Setup EAS
41 uses: expo/expo-github-action@v8
42 with:
43 expo-version: latest
44 eas-version: latest
45 token: ${{ secrets.EXPO_TOKEN }}
46
47 - name: ⛏️ Setup EAS local builds
48 run: yarn global add eas-cli-local-build-plugin
49
50 - name: ⚙️ Install dependencies
51 run: yarn install
52
53 - uses: maxim-lobanov/setup-xcode@v1
54 with:
55 xcode-version: '15.3'
56
57 - name: ☕️ Setup Cocoapods
58 uses: maxim-lobanov/setup-cocoapods@v1
59 with:
60 version: 1.14.3
61
62 - name: 💾 Cache Pods
63 uses: actions/cache@v3
64 id: pods-cache
65 with:
66 path: ./ios/Pods
67 # We'll use the yarn.lock for our hash since we don't yet have a Podfile.lock. Pod versions will not
68 # change unless the yarn version changes as well.
69 key: ${{ runner.os }}-pods-${{ hashFiles('yarn.lock') }}
70
71 - name: 🔤 Compile translations
72 run: yarn intl:build
73
74 - name: ✏️ Write environment variables
75 run: |
76 echo "${{ secrets.ENV_TOKEN }}" > .env
77 echo "EXPO_PUBLIC_BUNDLE_IDENTIFIER=$(git rev-parse --short HEAD)" >> .env
78 echo "EXPO_PUBLIC_BUNDLE_DATE=$(date -u +"%y%m%d%H")" >> .env
79 echo "${{ secrets.GOOGLE_SERVICES_TOKEN }}" > google-services.json
80
81 - name: 🏗️ EAS Build
82 run: yarn use-build-number-with-bump eas build -p ios --profile ${{ inputs.profile || 'testflight' }} --local --output build.ipa --non-interactive
83
84 - name: 🚀 Deploy
85 run: eas submit -p ios --non-interactive --path build.ipa
86
87 - name: 📚 Get version from package.json
88 id: get-build-info
89 run: bash scripts/setGitHubOutput.sh
90
91 - name: 🔔 Notify Slack of Production Build
92 if: ${{ inputs.profile == 'production' }}
93 uses: slackapi/slack-github-action@v1.25.0
94 with:
95 payload: |
96 {
97 "text": "iOS production build for App Store submission is ready!\n```Artifact: Check TestFlight to know when it is available\nVersion Number: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}\nBuild Number: ${{ steps.get-build-info.outputs.BSKY_IOS_BUILD_NUMBER }}```"
98 }
99 env:
100 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }}
101 SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
102
103 - name: ⬇️ Restore Cache
104 id: get-base-commit
105 uses: actions/cache@v4
106 if: ${{ inputs.profile == 'testflight' }}
107 with:
108 path: most-recent-testflight-commit.txt
109 key: most-recent-testflight-commit
110
111 - name: ✏️ Write commit hash to cache
112 if: ${{ inputs.profile == 'testflight' }}
113 run: echo ${{ github.sha }} > most-recent-testflight-commit.txt