generated from OwnTube-tv/cust-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
239 lines (214 loc) · 10.5 KB
/
build_branded_main.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: Build mobile artifacts & deploy static content to Pages for a branded app
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
upload_ios_to_testflight:
description: "Upload the iOS build to Testflight"
type: boolean
upload_tvos_to_testflight:
description: "Upload the tvOS build to Testflight"
type: boolean
google_play_track:
description: "Upload the app to the following Google Play track:"
type: choice
required: false
default: none
options:
- none
- internal
- alpha
- beta
- production
google_play_upload_tv:
description: "Upload the Android TV build to selected Google Play track?"
type: boolean
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "owntube-build"
cancel-in-progress: false
jobs:
choose_macos_runner:
runs-on: ubuntu-latest
environment: owntube
outputs:
runner-label: ${{ steps.set-macos-runner.outputs.runner-label }}
steps:
- name: Set macos runner
id: set-macos-runner
run: |
echo "runner-label=${{ vars.PREFERRED_MACOS_RUNNER || 'macos-latest' }}" >> $GITHUB_OUTPUT
build_info:
runs-on: ubuntu-latest
outputs:
BUILD_INFO: ${{ steps.write.outputs.BUILD_INFO }}
steps:
- id: create
name: "@${{ github.actor }} initiated GitHub Pages deployment, prepare build info"
run: |
# Builder username on GitHub
echo "GITHUB_ACTOR=${{ github.actor }}" && echo "GITHUB_ACTOR=${{ github.actor }}" >> "$GITHUB_OUTPUT"
# Create short Git SHA equivalent to `$(git rev-parse --short HEAD)` e.g. "d1f5cfd"
GITHUB_SHA_SHORT="${GITHUB_SHA::7}"
echo "GITHUB_SHA_SHORT=$GITHUB_SHA_SHORT" && echo "GITHUB_SHA_SHORT=$GITHUB_SHA_SHORT" >> "$GITHUB_OUTPUT"
# Create commit URL, e.g. "https://github.com/OwnTube-tv/web-client/commit/d1f5cfd"
COMMIT_URL="https://github.com/${{ github.repository }}/commit/$GITHUB_SHA_SHORT"
echo "COMMIT_URL=$COMMIT_URL" && echo "COMMIT_URL=$COMMIT_URL" >> "$GITHUB_OUTPUT"
# Create ISO format build timestamp in UTC, e.g. "2024-02-19T13:12:52Z"
BUILD_TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "BUILD_TIMESTAMP=$BUILD_TIMESTAMP" && echo "BUILD_TIMESTAMP=$BUILD_TIMESTAMP" >> "$GITHUB_OUTPUT"
# Extract part after '/' in github.repository
REPO_NAME=$(echo "${{ github.repository }}" | awk -F/ '{print $2}')
echo "REPO_NAME=$REPO_NAME" && echo "REPO_NAME=$REPO_NAME" >> "$GITHUB_OUTPUT"
# Create web url
WEB_URL="https://${{ github.repository_owner }}.github.io/$REPO_NAME"
echo "WEB_URL=$WEB_URL" && echo "WEB_URL=$WEB_URL" >> "$GITHUB_OUTPUT"
- id: write
run: |
echo "BUILD_INFO<<EOF" >> $GITHUB_OUTPUT
echo "{
\"GITHUB_ACTOR\": \"${{ steps.create.outputs.GITHUB_ACTOR }}\",
\"GITHUB_SHA_SHORT\": \"${{ steps.create.outputs.GITHUB_SHA_SHORT }}\",
\"COMMIT_URL\": \"${{ steps.create.outputs.COMMIT_URL }}\",
\"BUILD_TIMESTAMP\": \"${{ steps.create.outputs.BUILD_TIMESTAMP }}\",
\"WEB_URL\": \"${{ steps.create.outputs.WEB_URL }}\"
}
" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
customizations_setup:
runs-on: ubuntu-latest
environment: owntube
outputs:
CUSTOMIZATIONS_ENV_CONTENT: ${{ steps.read_customization_file.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read the customization env file
id: read_customization_file
run: |
echo 'CUSTOMIZATIONS_ENV_CONTENT<<EOF' >> $GITHUB_OUTPUT
cat "./.customizations" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
deploy_web:
needs: [build_info, customizations_setup]
uses: OwnTube-tv/web-client/.github/workflows/deploy_web.yml@main
with:
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
build_android_apk:
needs: [build_info, customizations_setup]
uses: OwnTube-tv/web-client/.github/workflows/build_android_apk.yml@main
with:
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
build_android_tv_apk:
needs: [build_info, customizations_setup]
uses: OwnTube-tv/web-client/.github/workflows/build_android_tv_apk.yml@main
with:
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
google_play_mobile:
needs: [build_info, customizations_setup]
uses: OwnTube-tv/web-client/.github/workflows/google_play.yml@main
if: ${{ github.event.inputs.google_play_track != 'none' }}
secrets:
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
RELEASE_KEYSTORE_CONTENT_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_CONTENT_BASE64 }}
SERVICE_ACCOUNT_JSON: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
with:
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
track: ${{ github.event.inputs.google_play_track }}
use_parent_repo_customizations: true
google_play_tv:
needs: [build_info, customizations_setup]
uses: OwnTube-tv/web-client/.github/workflows/google_play.yml@main
if: ${{ github.event.inputs.google_play_track != 'none' && github.event.inputs.google_play_upload_tv == 'true' }}
secrets:
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
RELEASE_KEYSTORE_CONTENT_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_CONTENT_BASE64 }}
SERVICE_ACCOUNT_JSON: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
with:
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
track: ${{ github.event.inputs.google_play_track }}
isTV: true
use_parent_repo_customizations: true
testflight_ios:
if: ${{ github.event.inputs.upload_ios_to_testflight == 'true' }}
needs: [build_info, customizations_setup, choose_macos_runner]
uses: OwnTube-tv/web-client/.github/workflows/testflight.yml@main
secrets:
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_BUILD_CERTIFICATE_BASE64 }}
PROVISIONING_PROFILE_BASE64: ${{ secrets.IOS_BUILD_PROVISION_PROFILE_BASE64 }}
P12_PASSWORD: ${{ secrets.IOS_P12_PASSWORD}}
PROVISIONING_PROFILE_SPECIFIER: ${{ secrets.IOS_PROVISIONING_PROFILE_SPECIFIER }}
APPLE_DEVELOPMENT_TEAM: ${{ secrets.APPLE_DEVELOPMENT_TEAM }}
APPLE_API_PRIVATE_KEY: ${{ secrets.APPLE_API_PRIVATE_KEY }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
with:
target: iphoneos
runner-label: ${{ needs.choose_macos_runner.outputs.runner-label }}
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
code_sign_identity: iPhone Distribution
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
testflight_tvos:
if: ${{ github.event.inputs.upload_tvos_to_testflight == 'true' }}
needs: [build_info, customizations_setup, choose_macos_runner]
uses: OwnTube-tv/web-client/.github/workflows/testflight.yml@main
secrets:
BUILD_CERTIFICATE_BASE64: ${{ secrets.TVOS_BUILD_CERTIFICATE_BASE64 }}
PROVISIONING_PROFILE_BASE64: ${{ secrets.TVOS_BUILD_PROVISION_PROFILE_BASE64 }}
P12_PASSWORD: ${{ secrets.TVOS_P12_PASSWORD}}
PROVISIONING_PROFILE_SPECIFIER: ${{ secrets.TVOS_PROVISIONING_PROFILE_SPECIFIER }}
APPLE_DEVELOPMENT_TEAM: ${{ secrets.APPLE_DEVELOPMENT_TEAM }}
APPLE_API_PRIVATE_KEY: ${{ secrets.APPLE_API_PRIVATE_KEY }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
with:
target: appletvos
runner-label: ${{ needs.choose_macos_runner.outputs.runner-label }}
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
code_sign_identity: Apple Distribution
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
build_ios_simulator_app:
needs: [build_info, customizations_setup, choose_macos_runner]
uses: OwnTube-tv/web-client/.github/workflows/build_ios_simulator_app.yml@main
with:
runner-label: ${{ needs.choose_macos_runner.outputs.runner-label }}
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true
build_tvos_simulator_app:
needs: [build_info, customizations_setup, choose_macos_runner]
uses: OwnTube-tv/web-client/.github/workflows/build_tvos_simulator_app.yml@main
with:
runner-label: ${{ needs.choose_macos_runner.outputs.runner-label }}
customizations_env_content: ${{ needs.customizations_setup.outputs.CUSTOMIZATIONS_ENV_CONTENT }}
build_info: ${{ needs.build_info.outputs.BUILD_INFO }}
owntube_source: OwnTube-tv/web-client
use_parent_repo_customizations: true