-
Notifications
You must be signed in to change notification settings - Fork 35
288 lines (249 loc) · 8.85 KB
/
release.yml
File metadata and controls
288 lines (249 loc) · 8.85 KB
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
name: Release
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
BUILD_TYPE: Release
jobs:
versioning:
name: Semantic Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
- run: cp .github/workflows/package.json . && npm install && npx semantic-release
# Single deploy job since we're just deploying
deploy:
name: Deploy Docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: versioning
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'main'
- name: Setup GitHub Pages
uses: actions/configure-pages@v2
- name: Install dependencies
run: sudo apt update && sudo apt install -y doxygen graphviz dia git && pip install sphinx breathe m2r2 sphinxcontrib-googleanalytics==0.2.dev20220708 sphinxcontrib-jquery
- name: Clone Theme
run: git clone https://github.com/unum-cloud/www.unum.cloud-furo && cd www.unum.cloud-furo && pip install . && cd ../
- name: Install UKV from PyPi
run: pip install ukv
# - name: Fetch GoLang repo
# run: git submodule update --init --recursive --remote go-ustore/
- name: Build documentation
run: cd docs && doxygen conf.dox && make html
- name: Copy assets
run: cp -r assets build/docs/html/
- name: Upload artifacts
uses: actions/upload-pages-artifact@v1
with:
path: "./build/docs/html/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
build_ustore_amd64:
name: Build Libraries on AMD
runs-on: ubuntu-latest
needs: versioning
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
ref: 'main'
- run: git submodule update --init --recursive
- name: Prepare CMake, Conan and PyArrow
run: python -m pip install --force-reinstall numpy pyarrow cmake conan==1.60.1
- name: Install Conan dependencies
run: |
last_tag=$(curl https://api.github.com/repos/unum-cloud/ustore-deps/releases/latest | grep -i 'tag_name' | awk -F '\"' '{print $4}')
wget -q https://github.com/unum-cloud/ustore-deps/releases/download/"$last_tag"/ustore_deps_x86_linux.tar.gz
conan profile new --detect default
conan profile update settings.compiler.libcxx=libstdc++11 default
tar -xzf ./ustore_deps_x86_linux.tar.gz -C ~/.conan
package_version=$(ls ~/.conan/data/ustore_deps/)
conan install ustore_deps/"$package_version"@unum/x86_linux -g cmake -s compiler.version=11
rm -rf ./ustore_deps_x86_linux.tar.gz
- name: Configure CMake
run: |
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSTORE_BUILD_TESTS=0 \
-DUSTORE_BUILD_BENCHMARKS=0 \
-DUSTORE_BUILD_ENGINE_UCSET=1 \
-DUSTORE_BUILD_ENGINE_LEVELDB=1 \
-DUSTORE_BUILD_ENGINE_ROCKSDB=1 \
-DUSTORE_BUILD_API_FLIGHT_CLIENT=0 \
-DUSTORE_BUILD_API_FLIGHT_SERVER=1 \
-DUSE_CONAN=1 \
-B ./build_release .
- name: Build
run: make -j 4 -C ./build_release
- name: Upload Precompiled binaries to Release Assets
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./build_release/build/bin/ustore_flight_server*"
update_latest_release: true
build_wheel:
name: Build Python ${{ matrix.python }} on ${{ matrix.arch }}
runs-on: ubuntu-latest
needs: deploy
strategy:
matrix:
arch: ["x86_64", "aarch64"]
python: ["cp39-*", "cp310-*"]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
ref: 'main'
- name: Prepare CMake, Conan and PyArrow
run: python -m pip install --force-reinstall numpy pyarrow cmake conan==1.60.1
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,amd64'
- name: Build wheel
run: |
pip install cibuildwheel twine
CIBW_BUILD=${{ matrix.python }} cibuildwheel --platform linux
env:
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish_python:
name: Publish Python
needs: build_wheel
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ustore
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3.0.2
with:
path: ./dist/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/artifact
verbose: true
print-hash: true
build_and_publish_java:
name: Build and Publish Java
needs: versioning
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: 'main'
- name: Prepare CMake, Conan and PyArrow
run: python -m pip install --force-reinstall numpy pyarrow cmake conan==1.60.1
- name: Install default jdk
run: |
sudo apt update
sudo apt install default-jdk -y
- name: Install UStore dependencies using conan
run: |
last_tag=$(curl https://api.github.com/repos/unum-cloud/ustore-deps/releases/latest | grep -i 'tag_name' | awk -F '\"' '{print $4}')
wget -q https://github.com/unum-cloud/ustore-deps/releases/download/"$last_tag"/ustore_deps_x86_linux.tar.gz
conan profile new --detect default
conan profile update settings.compiler.libcxx=libstdc++11 default
tar -xzf ./ustore_deps_x86_linux.tar.gz -C ~/.conan
package_version=$(ls ~/.conan/data/ustore_deps/)
conan install ustore_deps/"$package_version"@unum/x86_linux -g cmake -s compiler.version=11
rm -rf ./ustore_deps_x86_linux.tar.gz
- name: Build and test java
run: |
mkdir -p ./tmp
export USTORE_TEST_PATH="./tmp/"
sed -i 's/make -j/make -j4/' /home/runner/work/ustore/ustore/java/pack.sh
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
bash java/pack.sh
- name: Publish java
run: ./java/gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish_docker:
name: Build and Publish Docker
needs: versioning
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
arch: ["amd64", "arm64"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: 'main'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'amd64,arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64, linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Log in to GitHub Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Dockerfile and ARGS
id: args
run: |
sed -i 's/make -j32/make -j4/' ./Dockerfile
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/${{ matrix.arch }}
build-args: |
version=${{ steps.args.outputs.version }}
TEST_USTORE="False"
tags: |
unum/ustore:${{ steps.args.outputs.version }}-jammy
unum/ustore:latest
ghcr.io/unum-cloud/ustore:${{ steps.args.outputs.version }}-jammy
ghcr.io/unum-cloud/ustore:latest