forked from microbit-foundation/cctd-ml-machine
-
Notifications
You must be signed in to change notification settings - Fork 7
89 lines (72 loc) · 2.78 KB
/
ios-build.yml
File metadata and controls
89 lines (72 loc) · 2.78 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: iOS Build
on:
release:
types: [created]
push:
branches:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ startsWith(github.ref, 'refs/tags/v') && 'release' || github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') }}
jobs:
build-ios:
# Only run for apps releases, not web releases
if: ${{ github.event_name != 'release' || contains(github.event.release.tag_name, '-apps') }}
timeout-minutes: 25
runs-on: macos-26
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
registry-url: "https://npm.pkg.github.com"
- uses: microbit-foundation/npm-package-versioner-action@v1
# Strip prerelease suffix - app stores require X.Y.Z format
- name: Set marketing version
run: echo "MARKETING_VERSION=$(jq -r .version package.json | sed 's/-.*//')" >> $GITHUB_ENV
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Setup SSH for Match
run: |
eval "$(ssh-agent -s)"
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
ssh-add - <<< "$FASTLANE_MATCH_DEPLOY_KEY"
env:
FASTLANE_MATCH_DEPLOY_KEY: ${{ secrets.FASTLANE_MATCH_DEPLOY_KEY }}
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "ML_THEME_VERSION=$(jq -r '.["theme-package-version"]' workflow-config.json)" >> $GITHUB_ENV
- run: npm install --no-save @microbit-foundation/ml-trainer-microbit@${{ env.ML_THEME_VERSION }}
if: github.repository_owner == 'microbit-foundation'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run build:apps
- run: npx cap sync ios
- run: pod install
working-directory: ios/App
- name: Build with Fastlane
run: bundle exec fastlane ios build
env:
MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_PASSWORD }}
BUILD_NUMBER: ${{ github.run_number }}
MARKETING_VERSION: ${{ env.MARKETING_VERSION }}
- uses: actions/upload-artifact@v4
with:
name: ios-app-${{ github.sha }}
path: ios/App/build/output/*.ipa
retention-days: 30
- name: Upload to TestFlight
if: github.event_name == 'release'
run: bundle exec fastlane ios upload
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}