-
Notifications
You must be signed in to change notification settings - Fork 27
289 lines (275 loc) · 8.17 KB
/
build-and-publish.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
277
278
279
280
281
282
283
284
285
286
287
288
289
name: Build & Publish
on:
pull_request:
branches:
- main
push:
branches:
- main
release:
types:
- released
env:
IB_VERSION: 10.19.04
DH_VERSION: 0.34.1
jobs:
build-ib-whl:
name: Build IB WHL
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
python3 --version
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements_dhib_env.txt
python3 dhib_env.py ib-wheel --ib_version ${{ env.IB_VERSION }}
find . -name \*.whl
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: ib-wheels
path: |
dist/ib/*
build-whl:
name: Build WHL
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel build twine
- name: Set output version
id: version
run: |
TAG_NAME=${{ github.event.release.tag_name }}
if [ -z "${TAG_NAME}" ]
then
if [ "$GITHUB_REF" = "refs/heads/main" ]
then
echo "::set-output name=version::0.0.0-rc.0"
else
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo "::set-output name=version::0.0.0-dev.${PR_NUMBER}"
fi
else
SEMVER="${TAG_NAME:1}"
echo "::set-output name=version::${SEMVER}"
fi
- name: Build
env:
DH_IB_VERSION: ${{ steps.version.outputs.version }}
DH_VERSION: ${{ env.DH_VERSION }}
run: |
python -m build
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist/*
publish-whl:
name: Publish WHL
runs-on: ubuntu-22.04
needs: [build-whl]
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: wheel/
- name: Publish WHL to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.DEEPHAVENIB_PYPI_TOKEN }}
packages_dir: wheel/
build-sphinx:
name: Build Sphinx
runs-on: ubuntu-22.04
needs: [build-ib-whl, build-whl]
steps:
- uses: actions/checkout@v1
- name: Apt installs
run: |
sudo apt update
sudo apt install -y openjdk-17-jdk
- name: Pip installs
run: pip3 install --upgrade sphinx~=7.3.0 sphinx-autodoc-typehints furo==2024.5.6
- name: Download IB wheels
uses: actions/download-artifact@v3
with:
name: ib-wheels
- name: Install IB Whl
run: pip3 install *.whl
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels
- name: Install Whl
run: pip3 install *.whl
- name: Run Sphinx
working-directory: ./sphinx
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
run: |
make html
touch build/html/.nojekyll
- name: Archive Sphinx artifacts
uses: actions/upload-artifact@v1
with:
name: documentation-html
path: sphinx/build/html/
- name: Upload JVM Error Logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: check-ci-jvm-err
path: '**/*_pid*.log'
if-no-files-found: ignore
publish-sphinx:
name: Publish Sphinx
runs-on: ubuntu-22.04
needs: [build-sphinx]
if: ${{ github.event_name == 'release' && github.event.action == 'released' }}
steps:
- uses: actions/checkout@v1
- name: Download Sphinx Artifacts
uses: actions/download-artifact@v3
with:
name: documentation-html
path: html/
- name: Deploy Sphinx docs to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: html/
- name: Upload JVM Error Logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: sphinx-jvm-err
path: '**/*_pid*.log'
if-no-files-found: ignore
docker-pip:
name: Build and Publish Docker (pip-installed Deephaven)
runs-on: ubuntu-22.04
needs: [build-ib-whl, build-whl]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.2
- name: Download IB wheels
uses: actions/download-artifact@v3
with:
name: ib-wheels
path: ib-wheels/
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: wheels/
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta-base
uses: docker/metadata-action@v4.0.1
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,${{ steps.branch-name.outputs.current_branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./.github/workflows/Dockerfile.pip
push: true
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}
build-args: IB_VERSION=${{ env.IB_VERSION }}
env:
IMAGE_NAME: ${{ github.repository }}
docker-dhserver:
name: Build and Publish Docker (Deephaven server image)
runs-on: ubuntu-22.04
needs: [build-ib-whl, build-whl]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.2
- name: Download IB wheels
uses: actions/download-artifact@v3
with:
name: ib-wheels
path: ib-wheels/
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: wheels/
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta-base
uses: docker/metadata-action@v4.0.1
with:
images: ghcr.io/${{ github.repository }}-dhserver
labels: deephaven_version=${{ env.DH_VERSION }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,${{ steps.branch-name.outputs.current_branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./.github/workflows/Dockerfile.server
push: true
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}
build-args: |
IB_VERSION=${{ env.IB_VERSION }}
DH_VERSION=${{ env.DH_VERSION }}
env:
IMAGE_NAME: ${{ github.repository }}-dhserver