-
Notifications
You must be signed in to change notification settings - Fork 11
160 lines (150 loc) · 4.48 KB
/
release.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Release
on:
workflow_dispatch:
push:
branches: [main]
concurrency:
group: release
cancel-in-progress: true
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
jobs:
checks:
uses: ./.github/workflows/checks.yml
prepare:
runs-on: ubuntu-latest
needs: checks
outputs:
release-version: ${{ steps.bump-version.outputs.next }}
steps:
- uses: shabados/actions/setup-git-identity@release/v3
with:
user: Shabad OS Bot
email: [email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_BOT_TOKEN }}
- uses: shabados/actions/bump-version@release/v3
id: bump-version
- uses: shabados/actions/generate-changelog@release/v3
- uses: ./.github/actions/upload-workspace
build:
needs: prepare
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
profile: [next, latest]
platform: [ios, android]
os: [macos-14, ubuntu-latest]
exclude:
- platform: android
os: macos-14
- platform: ios
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download-workspace
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- uses: ./.github/actions/cache-pods
if: matrix.platform == 'ios'
- uses: actions/setup-java@v4
if: matrix.platform == 'android'
with:
distribution: temurin
java-version-file: .java-version
cache: gradle
- run: |
npm run build -- \
--non-interactive \
--platform ${{ matrix.platform }} \
--profile ${{ matrix.profile }}
shell: bash
env:
EAS_LOCAL_BUILD_SKIP_CLEANUP: '1'
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.profile }}-${{ matrix.platform }}
path: |
**/*.aab
**/*.ipa
submit:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
profile: [next, latest]
platform: [ios, android]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.profile }}-${{ matrix.platform }}
- name: EAS Submit
run: |
build_path=$(find -name "*.ipa" -or -name "*.aab" -type f)
echo "Submitting $build_path to EAS"
npx eas-cli submit \
--non-interactive \
--path $build_path \
--platform ${{ matrix.platform }} \
--profile ${{ matrix.profile }}
env:
APP_ENV: ${{ matrix.profile }}
promote-external-testflight:
runs-on: ubuntu-latest
needs: submit
strategy:
fail-fast: false
matrix:
profile: [next, latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- uses: ./.github/actions/setup-fastlane
- name: Read bundle identifier
run: echo "PILOT_APP_IDENTIFIER=$(npm exec expo config -- --json | jq -r .ios.bundleIdentifier)" >> $GITHUB_ENV
env:
APP_ENV: ${{ matrix.profile }}
- run: fastlane run pilot
env:
PILOT_PLATFORM: ios
PILOT_GROUPS: Beta Testers
PILOT_DISTRIBUTE_EXTERNAL: true
PILOT_DISTRIBUTE_ONLY: true
PILOT_NOTIFY_EXTERNAL_TESTERS: false
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
# In future, we can have a the job that publish
# a reviewed app to the App Store and Google Play Store
# and publish to GitHub releases to close off the version.
# For now, this should only be approved once a version has been
# published to the App Store + Play Store.
publish:
runs-on: ubuntu-latest
needs: [prepare, submit]
environment: latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: shabados/actions/publish-github@release/v3
with:
github_token: ${{ secrets.GH_BOT_TOKEN }}
release_version: ${{ needs.prepare.outputs.release-version }}
asset_paths: |
**/*.aab
**/*.ipa