-
Notifications
You must be signed in to change notification settings - Fork 327
222 lines (188 loc) · 7.52 KB
/
release-wave.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
name: Release Wave
on:
workflow_dispatch:
inputs:
version:
description: "Release Version"
required: true
skipDocsPublish:
description: "Skip publishing docs site"
required: false
default: "false"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: "${{ github.event.inputs.version }}"
TAG: "v${{ github.event.inputs.version }}"
permissions:
id-token: write
contents: write
jobs:
release:
name: Release Wave
runs-on: ubuntu-20.04
outputs:
build-version: ${{ env.VERSION }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-go@v1
with:
go-version: "1.22"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: make setup
# - uses: r-lib/actions/setup-r@v2
# - uses: r-lib/actions/setup-r-dependencies@v2
# with:
# working-directory: ./r
- name: Build Release
run: make release
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Unit Test
run: |
make test-ui-ci
make setup-py-tests
make test-py-ci
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ env.TAG }}
release_name: ${{ env.TAG }}
draft: false
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
build/wave-${{ env.VERSION }}-darwin-amd64.tar.gz
build/wave-${{ env.VERSION }}-darwin-arm64.tar.gz
build/wave-${{ env.VERSION }}-linux-amd64.tar.gz
build/wave-${{ env.VERSION }}-windows-amd64.tar.gz
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_10_9_x86_64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_11_0_arm64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_12_0_arm64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-manylinux1_x86_64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-win_amd64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-any.whl
# r/build/h2owave_${{ env.VERSION }}_R.tar.gz
tag_name: ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Conda
uses: marek-mihok/[email protected]
with:
CondaDir: "py/h2o_wave/conda"
Platforms: "noarch"
CondaUsername: ${{ secrets.CONDA_USERNAME }}
CondaPassword: ${{ secrets.CONDA_PASSWORD }}
env:
# VERSION clashes with conda build. Use PKG_VERSION instead.
PKG_VERSION: ${{ env.VERSION }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
packages_dir: py/h2o_wave/dist
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish Docs
if: ${{ github.event.inputs.skipDocsPublish == 'false' }}
run: |
make publish-website
aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
env:
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_WEST_REGION }}
- name: Publish to S3
run: make publish-release-s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_EAST_REGION }}
- name: Publish apps for Cloud
run: make build-apps publish-apps-s3-hac
env:
HAC_S3_BUCKET: ${{ secrets.HAC_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_WEST_REGION }}
- name: Configure MC AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.MC_IAM_ROLE }}
role-session-name: wave-apps
aws-region: ${{ secrets.MC_AWS_REGION }}
- name: Publish apps for Managed Cloud
run: make publish-apps-s3-mc
env:
MC_S3_BUCKET: ${{ secrets.MC_S3_BUCKET }}
AWS_REGION: ${{ secrets.MC_AWS_REGION }}
# Call some time after cloudfront cache bust - crawler needs to hit fresh cache.
- name: Reindex Algolia search
run: |
curl -X POST -H "Content-Type: application/json" --user $ALGOLIA_CRAWLER_USER_ID:$ALGOLIA_CRAWLER_API_KEY https://crawler.algolia.com/api/1/crawlers/$ALGOLIA_CRAWLER_ID/reindex
env:
ALGOLIA_CRAWLER_API_KEY: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }}
ALGOLIA_CRAWLER_ID: ${{ secrets.ALGOLIA_CRAWLER_ID }}
ALGOLIA_CRAWLER_USER_ID: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }}
- name: Build university
run: make publish-university
- name: Publish to PyPI - wave_university
uses: pypa/gh-action-pypi-publish@master
with:
packages_dir: university/dist
password: ${{ secrets.PYPI_UNIVERSITY_TOKEN }}
- name: Publish to PyPI - lightwave
uses: pypa/gh-action-pypi-publish@master
with:
packages_dir: py/h2o_lightwave/dist
password: ${{ secrets.PYPI_LIGTHWAVE_TOKEN }}
- name: Publish to PyPI - lightwave_web
uses: pypa/gh-action-pypi-publish@master
with:
packages_dir: py/h2o_lightwave_web/dist
password: ${{ secrets.PYPI_LIGTHWAVE_WEB_TOKEN }}
- name: Download H2O CLI
working-directory: ./py/tmp/tour/
run: mkdir -p .bin && curl -o .bin/h2o https://h2oai-cloud-release.s3.amazonaws.com/releases/ai/h2o/h2o-cloud/latest/cli/linux-amd64/h2o
- name: Change permissions
working-directory: ./py/tmp/tour/
run: chmod +x .bin/h2o
- name: Make air-gapped bundle
working-directory: ./py/tmp/tour/
run: |
.bin/h2o bundle \
--docker-base-image 524466471676.dkr.ecr.us-east-1.amazonaws.com/q8s/launcher:v0.31.0-310 \
--docker-use-buildkit \
--generate-helm-charts \
--helm-chart-version ${{ env.VERSION }} \
--helm-chart-name tour \
--helm-app-bundle-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/tour-bundle \
--helm-app-runtime-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/tour \
--generate-dockerfile
- uses: actions/upload-artifact@v4
with:
name: wave-bundle
path: |
./py/tmp/tour/*.Dockerfile
./py/tmp/tour/*.wave
- uses: actions/upload-artifact@v4
with:
name: wave-bundle-helm
path: py/tmp/tour/helm/
- name: Remove files in tmp folder
run: make remove-build-apps-directory
build-and-publish:
needs: release
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
uses: ./.github/workflows/wave-bundle-docker-build-publish.yaml
with:
build-version: ${{ needs.release.outputs.build-version }}
bundle-artifact: wave-bundle
wave-app-name: tour