-
Notifications
You must be signed in to change notification settings - Fork 699
276 lines (272 loc) · 10.5 KB
/
release_kolibri.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: Release Kolibri
on:
release:
types: [published]
jobs:
latest_release:
name: Check if this release is the latest release
runs-on: ubuntu-latest
outputs:
is_latest_release: ${{ steps.is_latest_release.outputs.result }}
steps:
- name: Check if the current release is the latest Kolibri release
id: is_latest_release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: latestRelease } = await github.rest.repos.getLatestRelease({
owner: 'learningequality',
repo: 'kolibri',
});
return latestRelease.tag_name === '${{ github.event.release.tag_name }}';
whl:
name: Build WHL file
uses: ./.github/workflows/build_whl.yml
upload_whl:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: whl
with:
filename: ${{ needs.whl.outputs.whl-file-name }}
release_id: ${{ github.event.release.id }}
upload_tar:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: whl
with:
filename: ${{ needs.whl.outputs.tar-file-name }}
release_id: ${{ github.event.release.id }}
pex:
name: Build PEX file
needs: whl
uses: ./.github/workflows/build_pex.yml
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
upload_pex:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: pex
with:
filename: ${{ needs.pex.outputs.pex-file-name }}
release_id: ${{ github.event.release.id }}
dmg:
name: Build DMG file
needs: whl
uses: learningequality/kolibri-app/.github/workflows/build_mac.yml@v0.4.3
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
release: true
ref: v0.4.3
secrets:
KOLIBRI_MAC_APP_IDENTITY: ${{ secrets.KOLIBRI_MAC_APP_IDENTITY }}
KOLIBRI_MAC_APP_CERTIFICATE: ${{ secrets.KOLIBRI_MAC_APP_CERTIFICATE }}
KOLIBRI_MAC_APP_CERTIFICATE_PASSWORD: ${{ secrets.KOLIBRI_MAC_APP_CERTIFICATE_PASSWORD }}
KOLIBRI_MAC_APP_USERNAME: ${{ secrets.KOLIBRI_MAC_APP_USERNAME }}
KOLIBRI_MAC_APP_PASSWORD: ${{ secrets.KOLIBRI_MAC_APP_PASSWORD }}
KOLIBRI_MAC_APP_TEAM_ID: ${{ secrets.KOLIBRI_MAC_APP_TEAM_ID }}
upload_dmg:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: dmg
with:
filename: ${{ needs.dmg.outputs.dmg-file-name }}
release_id: ${{ github.event.release.id }}
deb:
name: Build DEB file
needs: whl
uses: learningequality/kolibri-installer-debian/.github/workflows/build_deb.yml@v0.16.1
with:
tar-file-name: ${{ needs.whl.outputs.tar-file-name }}
ref: v0.16.1
upload_deb:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: deb
with:
filename: ${{ needs.deb.outputs.deb-file-name }}
release_id: ${{ github.event.release.id }}
exe:
name: Build EXE file
needs: whl
uses: learningequality/kolibri-installer-windows/.github/workflows/build_exe.yml@v1.6.4
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
release: true
ref: v1.6.4
secrets:
KOLIBRI_WINDOWS_INSTALLER_CERTIFICATE: ${{ secrets.KOLIBRI_WINDOWS_INSTALLER_CERTIFICATE }}
KOLIBRI_WINDOWS_INSTALLER_CERTIFICATE_PASSWORD: ${{ secrets.KOLIBRI_WINDOWS_INSTALLER_CERTIFICATE_PASSWORD }}
upload_exe:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: exe
with:
filename: ${{ needs.exe.outputs.exe-file-name }}
release_id: ${{ github.event.release.id }}
zip:
name: Build Raspberry Pi Image
needs: deb
uses: learningequality/pi-gen/.github/workflows/build_zip.yml@v0.16.1
with:
deb-file-name: ${{ needs.deb.outputs.deb-file-name }}
ref: v0.16.1
upload_zip:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: zip
with:
filename: ${{ needs.zip.outputs.zip-file-name }}
release_id: ${{ github.event.release.id }}
apk:
name: Build Android APK
needs: whl
uses: learningequality/kolibri-installer-android/.github/workflows/build_apk.yml@v0.1.4
with:
tar-file-name: ${{ needs.whl.outputs.tar-file-name }}
release: true
ref: v0.1.4
secrets:
KOLIBRI_ANDROID_APP_PRODUCTION_KEYSTORE: ${{ secrets.KOLIBRI_ANDROID_APP_PRODUCTION_KEYSTORE }}
KOLIBRI_ANDROID_APP_PRODUCTION_KEYSTORE_PASSWORD: ${{ secrets.KOLIBRI_ANDROID_APP_PRODUCTION_KEYSTORE_PASSWORD }}
KOLIBRI_ANDROID_APP_PRODUCTION_KEYALIAS_PASSWORD: ${{ secrets.KOLIBRI_ANDROID_APP_PRODUCTION_KEYALIAS_PASSWORD }}
KOLIBRI_ANDROID_PLAY_STORE_API_SERVICE_ACCOUNT_JSON: ${{ secrets.KOLIBRI_ANDROID_PLAY_STORE_API_SERVICE_ACCOUNT_JSON }}
upload_apk:
uses: ./.github/workflows/upload_github_release_asset.yml
needs: apk
with:
filename: ${{ needs.apk.outputs.apk-file-name }}
release_id: ${{ github.event.release.id }}
test_pypi_upload:
name: Upload to TestPyPi
needs: whl
uses: ./.github/workflows/pypi_upload.yml
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
tar-file-name: ${{ needs.whl.outputs.tar-file-name }}
test: true
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TESTPYPI_API_TOKEN: ${{ secrets.TESTPYPI_API_TOKEN }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
gcs_upload:
name: Upload to Google Cloud Storage for LE Downloads
runs-on: ubuntu-latest
needs: [whl, pex, dmg, deb, exe, zip, apk]
strategy:
matrix:
filename: [
'${{ needs.whl.outputs.whl-file-name }}',
'${{ needs.whl.outputs.tar-file-name }}',
'${{ needs.pex.outputs.pex-file-name }}',
'${{ needs.dmg.outputs.dmg-file-name }}',
'${{ needs.deb.outputs.deb-file-name }}',
'${{ needs.exe.outputs.exe-file-name }}',
'${{ needs.zip.outputs.zip-file-name }}',
'${{ needs.apk.outputs.apk-file-name }}',
]
steps:
- name: Download ${{ matrix.filename }} artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.filename }}
path: dist
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload files to Google Cloud Storage
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/${{ matrix.filename }}'
destination: '${{ secrets.KOLIBRI_PUBLIC_RELEASE_GCS_BUCKET }}/downloads/kolibri/${{ github.event.release.name }}'
bck_prerelease_gcs_upload:
name: Upload WHL file to Google Cloud Storage for BCK Pre-release
runs-on: ubuntu-latest
needs: [whl]
steps:
- name: Download WHL artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.whl.outputs.whl-file-name }}
path: dist
- name: Zip whl file
run: zip -j dist/kolibri.zip dist/${{ needs.whl.outputs.whl-file-name }}
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload to BCK bucket
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/kolibri.zip'
destination: '${{ secrets.BCK_PRERELEASE_BUILD_ARTIFACT_GCS_BUCKET }}'
parent: false
- name: Unzip content static files from whl file
run: |
unzip dist/${{ needs.whl.outputs.whl-file-name }} 'kolibri/core/content/static/*' -d static
mv static/kolibri/core/content/static/** static
rm -rf static/kolibri
rm static/**/*.file_size
# Ungzip all .gz files in the static folder
for f in static/**/*.gz; do gunzip -f $f; done
- name: Upload content static files to BCK bucket
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'static'
destination: '${{ secrets.STUDIO_BCK_CONTENT_STATIC_BUCKET }}'
block_release_step:
# This step ties to the release environment which requires manual approval
# before it can execute. Once manual approval has been granted, the release is
# unblocked and all the subsequent steps in this workflow will happen.
name: Job to block publish of a release until it has been manually approved
if: ${{ !github.event.release.prerelease }}
needs: [whl, pex, dmg, deb, exe, zip, apk, test_pypi_upload]
runs-on: ubuntu-latest
environment: release
steps:
- run: echo "Release now publishing!"
pypi_upload:
name: Upload to PyPi
if: ${{ !github.event.release.prerelease }}
needs: [whl, block_release_step]
uses: ./.github/workflows/pypi_upload.yml
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
tar-file-name: ${{ needs.whl.outputs.tar-file-name }}
test: false
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TESTPYPI_API_TOKEN: ${{ secrets.TESTPYPI_API_TOKEN }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
bck_gcs_upload:
name: Upload WHL file to Google Cloud Storage for BCK
needs: [block_release_step, whl, latest_release]
if: ${{ !github.event.release.prerelease && needs.latest_release.outputs.is_latest_release == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Download WHL artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.whl.outputs.whl-file-name }}
path: dist
- name: Zip whl file
run: zip -j dist/kolibri.zip dist/${{ needs.whl.outputs.whl-file-name }}
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload to BCK bucket
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/kolibri.zip'
destination: '${{ secrets.BCK_PROD_BUILD_ARTIFACT_GCS_BUCKET }}'
parent: false
android_release:
name: Release Android App
if: ${{ !github.event.release.prerelease }}
needs: [apk, block_release_step]
uses: learningequality/kolibri-installer-android/.github/workflows/release_apk.yml@v0.1.4
with:
version-code: ${{ needs.apk.outputs.version-code }}
ref: v0.1.4
secrets:
KOLIBRI_ANDROID_PLAY_STORE_API_SERVICE_ACCOUNT_JSON: ${{ secrets.KOLIBRI_ANDROID_PLAY_STORE_API_SERVICE_ACCOUNT_JSON }}