-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathbuild-and-upload-to-testflight.yml
More file actions
111 lines (105 loc) · 3.57 KB
/
build-and-upload-to-testflight.yml
File metadata and controls
111 lines (105 loc) · 3.57 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build and upload to TestFlight
# Creates a temp branch, bumps version (build.yml), uploads IPA via upload-to-testflight.yml.
# Summary metadata is passed from build.yml outputs (no second checkout for version parsing).
#
on:
workflow_call:
inputs:
source_branch:
description: 'Branch, tag, or SHA to build'
required: true
type: string
environment:
description: 'Build environment / track (exp, beta, rc)'
required: true
type: string
testflight_group:
description: 'TestFlight external testing group'
required: false
type: string
default: 'MetaMask BETA & Release Candidates'
distribute_external:
description: 'Whether to distribute to external testers. Defaults to false; nightly-build.yml relies on the script default (true) so it always distributes externally.'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
source_branch:
description: 'Branch, tag, or SHA to build'
required: true
type: string
default: 'main'
environment:
description: 'Build environment / track'
required: true
type: choice
options:
- exp
- beta
- rc
default: rc
testflight_group:
description: 'TestFlight external testing group'
required: true
type: choice
default: 'MetaMask BETA & Release Candidates'
options:
- 'MetaMask BETA & Release Candidates'
- 'MM Card Team'
- 'Ramp Provider Testing'
distribute_external:
description: 'Whether to distribute to external testers'
required: false
type: boolean
default: false
permissions:
contents: write
id-token: write
jobs:
prepare-build-branch:
uses: ./.github/workflows/create-build-branch.yml
with:
source_branch: ${{ inputs.source_branch }}
secrets: inherit
build:
name: Build iOS (${{ inputs.environment }})
needs: [prepare-build-branch]
uses: ./.github/workflows/build.yml
with:
build_name: main-${{ inputs.environment }}
platform: ios
skip_version_bump: false
source_branch: ${{ needs.prepare-build-branch.outputs.build_branch }}
secrets: inherit
upload-ios-testflight:
needs: [prepare-build-branch, build]
uses: ./.github/workflows/upload-to-testflight.yml
with:
environment: ${{ inputs.environment }}
testflight_group: ${{ inputs.testflight_group || 'MetaMask BETA & Release Candidates' }}
source_branch: ${{ inputs.source_branch }}
build_branch: ${{ needs.prepare-build-branch.outputs.build_branch }}
build_name: main-${{ inputs.environment }}
build_commit_sha: ${{ needs.build.outputs.built_commit_sha }}
build_version: ${{ needs.build.outputs.semantic_version }}
build_number: ${{ needs.build.outputs.ios_version_code }}
distribute_external: ${{ inputs.distribute_external }}
secrets: inherit
cleanup-build-branch:
name: Cleanup build branch
needs: [prepare-build-branch, upload-ios-testflight]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PR_TOKEN || github.token }}
- name: Delete temporary build branch
env:
BRANCH: ${{ needs.prepare-build-branch.outputs.build_branch }}
run: |
if [ -n "$BRANCH" ]; then
git push origin --delete "$BRANCH" || true
echo "🧹 Deleted build branch: $BRANCH"
fi