forked from manticoresoftware/manticoresearch
-
Notifications
You must be signed in to change notification settings - Fork 0
326 lines (308 loc) · 9.82 KB
/
pack_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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: 📦 Pack and publish
run-name: 📦 Pack and publish ${{ github.sha }}
#on: workflow_call
on:
workflow_run:
workflows: [ 🔬 Test ]
types: [ completed ]
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened, labeled, unlabeled]
paths-ignore:
- 'manual/**'
- 'cmake/GetGALERA.cmake'
- 'galera_packaging/**'
push:
branches:
- manticore-*
paths-ignore:
- 'manual/**'
- 'cmake/GetGALERA.cmake'
- 'galera_packaging/**'
# cancels the previous workflow run when a new one appears in the same branch (e.g. master or a PR's branch)
concurrency:
group: pack_${{ github.ref }}
cancel-in-progress: true
jobs:
pack:
name: OK to pack?
runs-on: ubuntu-22.04
if: |
(
github.event_name == 'pull_request'
&&
(
contains(
github.event.pull_request.labels.*.name, 'pack'
)
||
contains(
github.event.pull_request.labels.*.name, 'publish'
)
)
)
||
(
github.event_name == 'workflow_run'
&&
github.event.workflow_run.conclusion == 'success'
&&
github.ref == 'refs/heads/master'
)
||
(
github.event_name == 'push'
&&
startsWith(
github.ref, 'refs/heads/manticore-'
)
)
steps:
- run: echo "All set to build packages"
- run: |
echo '# Packing and publishing all for commit ${{ github.sha }}' >> $GITHUB_STEP_SUMMARY
echo '* Commit URL: [${{ github.sha }}](/${{ github.repository }}/commit/${{ github.sha }})' >> $GITHUB_STEP_SUMMARY
echo '* Initiated by: [@${{ github.actor }}](https://github.com/${{ github.actor }})' >> $GITHUB_STEP_SUMMARY
echo '* Ref: ${{ github.ref_type }} "${{ github.ref_name }}"' >> $GITHUB_STEP_SUMMARY
echo '* Attempt: ${{ github.run_attempt }}' >> $GITHUB_STEP_SUMMARY
pack_debian_ubuntu:
name: Debian/Ubuntu packages
uses: ./.github/workflows/build_template.yml
needs: pack
strategy:
fail-fast: false
matrix:
DISTR: [bionic, focal, jammy, buster, bullseye, bookworm]
arch: [x86_64, aarch64]
with:
DISTR: ${{ matrix.DISTR }}
arch: ${{ matrix.arch }}
cmake_command: |
mkdir build
cd build
cmake -DPACK=1 ..
cmake --build . --target package
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
artifact_list: "build/manticore*deb"
pack_rhel:
name: RHEL packages
uses: ./.github/workflows/build_template.yml
needs: pack
strategy:
fail-fast: false
matrix:
DISTR: [rhel7, rhel8, rhel9]
arch: [x86_64, aarch64]
with:
DISTR: ${{ matrix.DISTR }}
arch: ${{ matrix.arch }}
boost: boost_rhel_feb17
cmake_command: |
ln -s $(pwd) /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0
cd /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0
mkdir build
cd build
cmake -DPACK=1 ..
cmake --build . --target package
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
artifact_list: "build/manticore*rpm"
pack_macos:
name: MacOS packages
uses: ./.github/workflows/build_template.yml
needs: pack
strategy:
fail-fast: false
matrix:
DISTR: [macos]
arch: [x86_64, arm64]
with:
DISTR: ${{ matrix.DISTR }}
arch: ${{ matrix.arch }}
HOMEBREW_PREFIX: /opt/homebrew
cmake_command: |
mkdir build
cd build
cmake -DPACK=1 ..
cmake --build . --target package
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
artifact_list: "build/manticore*tar.gz"
pack_windows:
name: Windows x64 package
uses: ./.github/workflows/build_template.yml
needs: pack
with:
DISTR: windows
arch: x64
sysroot: roots_apr15
cmake_command: |
mkdir build
cd build
cmake -DPACK=1 ..
cmake --build . --target package
cache_key: pack_windows_x64
artifact_list: "build/manticore*exe build/manticore*zip"
build_nsis:
name: Making Windows NSIS installer
needs: pack_windows
runs-on: ubuntu-22.04
container:
image: manticoresearch/build_nsis:1.0.0
env:
CI_COMMIT_SHA: ${{ github.sha }}
steps:
- name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
uses: actions/checkout@v3
- name: Initialization
# without adding the safe.directory the script fails to do git show ...
run: git config --global --add safe.directory /__w/manticoresearch/manticoresearch
- name: Make installer
# TODO: remove the hardcoded paths /builds/ below
run: |
mkdir -p /builds/manticoresearch/dev/build/
/bin/bash dist/build_dockers/nsis/nsis_src_parser.sh
shell: bash
- run: mv /builds/manticoresearch/dev/build build
- name: Upload artifact
uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: win_installer
path: build/manticore-*.exe
# virtual job to simplify the CI
# This job depends on all the package preparation jobs that have to pass before we can start publishing packages
publish:
name: OK to publish?
runs-on: ubuntu-22.04
needs: [pack_debian_ubuntu, pack_rhel, pack_macos, pack_windows]
if: |
(github.repository == 'manticoresoftware/manticoresearch')
&& (
(github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'publish')))
|| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
)
steps:
- run: echo "Ready to publish"
publish_debian_ubuntu:
needs: publish
strategy:
fail-fast: true
matrix:
DISTR: [bionic, focal, jammy, buster, bullseye, bookworm]
arch: [x86_64, aarch64]
runs-on: ubuntu-22.04
name: ${{ matrix.DISTR }} ${{ matrix.arch }} publishing
steps:
- uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: ${{ matrix.DISTR }}
arch: ${{ matrix.arch }}
artifact: build_${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }}
type: deb
delimiter: "-"
publish_rhel:
needs: publish
strategy:
fail-fast: true
matrix:
DISTR: [7, 8, 9]
arch: [x86_64, aarch64]
runs-on: ubuntu-22.04
name: RHEL ${{ matrix.DISTR }} ${{ matrix.arch }} publishing
steps:
- uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: ${{ matrix.DISTR }}
arch: ${{ matrix.arch }}
artifact: build_rhel${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }}
type: rpm
delimiter: "_"
publish_macos:
name: Publishing MacOS
needs: publish
strategy:
fail-fast: true
matrix:
arch: [x86_64, arm64]
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: macos
arch: ${{ matrix.arch }}
artifact: build_macos_RelWithDebInfo_${{ matrix.arch }}
type: arc
delimiter: "-"
publish_windows:
name: Publishing Windows packages to repo.manticoresearch.com
needs: publish
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: windows
arch: x64
artifact: build_windows_RelWithDebInfo_x64
type: arc
delimiter: "-"
publish_nsis:
name: Publishing Windows NSIS installer
needs: publish_windows
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr:
arch:
artifact: win_installer
type: arc
delimiter: "-"
build_docker:
name: Building and pushing docker
needs: publish_debian_ubuntu
runs-on: ubuntu-22.04
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
steps:
- name: Checkout repository # We have to checkout to access .github/workflows/ in further steps
uses: actions/checkout@v3
- name: Calculate short commit hash
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Building docker
run: CI_COMMIT_SHORT_SHA=${{ steps.sha.outputs.sha_short }} /bin/bash dist/dockerhub_deploy.sh
clt_rhel_dev_installation:
name: Testing RHEL dev packages installation
needs: publish_rhel
strategy:
fail-fast: false
matrix:
image: [ "centos:7", "almalinux:8", "almalinux:9", "oraclelinux:9", "amazonlinux:latest" ]
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
image: ${{ matrix.image }}
test_prefix: test/clt-tests/installation/rhel-dev-
run_args: -e TELEMETRY=0
clt_deb_dev_installation:
name: Testing DEB dev packages installation
needs: publish_debian_ubuntu
strategy:
fail-fast: false
matrix:
image: [ "ubuntu:bionic", "ubuntu:focal", "ubuntu:jammy", "debian:buster", "debian:bullseye", "debian:bookworm" ]
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/[email protected]
with:
image: ${{ matrix.image }}
test_prefix: test/clt-tests/installation/deb-dev-
run_args: -e TELEMETRY=0