-
Notifications
You must be signed in to change notification settings - Fork 0
873 lines (811 loc) · 29.7 KB
/
release.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
name: release
on:
push:
tags:
- 'v*.*.*'
env:
APP_NAME: 'manticore-executor'
DOCKER_TAG: 'manticoresearch/manticore-executor'
PHP_VERSION: '8.3.4'
MAINTAINER: 'Manticore'
DESC: 'Custom built PHP executor for Manticore.'
EXTRA_NAME: 'manticore-extra'
EXTRA_DESC: 'Manticore extra package that includes executor and columnar lib'
COLUMNAR_NAME: 'manticore-columnar-lib'
COLUMNAR_VERSION: '2.3.1'
GALERA_NAME: 'manticore-galera'
GALERA_VERSION: '3.37'
DOCKER_CLI_EXPERIMENTAL: enabled
jobs:
vars:
runs-on: ubuntu-22.04
outputs:
app_version: ${{ steps.vars.outputs.app_version }}
app_date: ${{ steps.vars.outputs.app_date }}
app_commit: ${{ steps.vars.outputs.app_commit }}
rpm_suffix: ${{ steps.vars.outputs.rpm_suffix }}
deb_suffix: ${{ steps.vars.outputs.deb_suffix }}
steps:
- uses: actions/checkout@v3
- id: vars
run: |
date=$( date +%y%m%d%H )
commit=${GITHUB_SHA:0:7}
echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT
echo "app_date=$date" >> $GITHUB_OUTPUT
echo "app_commit=$commit" >> $GITHUB_OUTPUT
echo "rpm_suffix=_${date}.$commit" >> $GITHUB_OUTPUT
echo "deb_suffix=-${date}-$commit" >> $GITHUB_OUTPUT
build-artifact:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs:
- vars
strategy:
matrix:
include:
- name: AMD64 with buildx for Linux
os: ubuntu-22.04
arch: amd64
use_buildx: true
run: ""
- name: ARM64 with buildx for Linux
os: ubuntu-22.04
arch: arm64
use_buildx: true
run: ""
- name: AMD64 native on OSX
os: macos-13
arch: x86_64
use_buildx: false
run: ./build-osx
- name: ARM64 native on OSX
os: macos-14
arch: arm64
use_buildx: false
run: ./build-osx
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
if: ${{ matrix.use_buildx == true }}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ matrix.use_buildx == true }}
uses: docker/setup-buildx-action@v3
- name: Build docker image
if: ${{ matrix.use_buildx == true }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/${{ matrix.arch }}
load: true
push: false
tags: ${{ env.DOCKER_TAG }}:${{ needs.vars.outputs.app_version }}
build-args: BUILD_DEV=0
- name: Create artifact
run: |
[ -n "${{ matrix.run }}" ] && ${{ matrix.run }} ${{ env.PHP_VERSION }} || true
APP_ARCH=${{ matrix.arch }} \
APP_VERSION=${{ needs.vars.outputs.app_version }} \
APP_NAME=${{ env.APP_NAME }} \
APP_DATE=${{ needs.vars.outputs.app_date }} \
RUNNER_OS="${{ runner.os }}" \
DOCKER_IMAGE=${{ env.DOCKER_TAG }}:${{ needs.vars.outputs.app_version }} \
./collect-assets
shell: bash
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-${{ matrix.os }}-${{ matrix.arch }}
path: ./*${{ matrix.arch }}.tar.gz
build-artifact-dev:
runs-on: ubuntu-22.04
needs:
- vars
steps:
- name: Checkout
uses: actions/checkout@v3
- id: vars
run: |
echo "app_version=$(echo ${{ github.ref_name }} | cut -dv -f2)" >> $GITHUB_OUTPUT
- name: Build manticore-executor-dev
run: ./build-linux 8.3.4 0 1
shell: bash
- name: Create artifact
run: |
APP_ARCH=amd64 \
APP_VERSION=${{ needs.vars.outputs.app_version }} \
APP_NAME=${{ env.APP_NAME }} \
APP_DATE=${{ needs.vars.outputs.app_date }} \
RUNNER_OS="${{ runner.os }}" \
ASSET_SUFFIX=-dev \
./collect-assets
shell: bash
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-dev-ubuntu-22.04-amd64
path: ./*.tar.gz
build-linux-packages:
needs:
- vars
- build-artifact
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: manticoresoftware/download_artifact_with_retries@main
with:
name: artifact-ubuntu-22.04-amd64
path: .
- name: Prepare packages structure
run: |
# name is like assets manticore-executor_v0.5.1-221214-e089052_linux_amd64:
tar -xzf *.tar.gz
# Setup openssl workaround
mkdir -p .debpkg/DEBIAN
cp -p packages/postrun .debpkg/DEBIAN/postinst
mkdir -p .debpkg/usr/bin
mkdir -p .rpmpkg/usr/bin
mkdir -p .rpmpkg/usr/share/
cp -p *_linux_amd64/${{ env.APP_NAME }} .debpkg/usr/bin/${{ env.APP_NAME }}
chmod +x .debpkg/usr/bin/${{ env.APP_NAME }}
# cp -p README.md .debpkg/README.md
# cp -p LICENSE .debpkg/LICENSE
cp -p *_linux_amd64/${{ env.APP_NAME }} .rpmpkg/usr/bin/${{ env.APP_NAME }}
cp -p LICENSE .rpmpkg/usr/share/${{ env.APP_NAME }}-LICENSE
cp -p README.md .rpmpkg/usr/share/${{ env.APP_NAME }}-README.md
- uses: manticoresoftware/actions-build-deb-action@master
with:
package: ${{ env.APP_NAME }}
package_root: .debpkg
maintainer: ${{ env.MAINTAINER }}
version: ${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.deb_suffix }}
arch: 'amd64'
desc: '${{ env.DESC }}'
license: 'PHP-3.01'
- name: Build RPM packages
run: |
sudo apt-get update -y -q
sudo apt-get install -y rpm
RPMBUILD_DIR="$HOME/rpmbuild"
RPMBUILD_SOURCE_DIR="$RPMBUILD_DIR/SOURCES"
RPMBUILD_SPEC_DIR="$RPMBUILD_DIR/SPECS"
WORKDIR="/tmp/work"
mkdir "$WORKDIR"
spec_file=main.spec
cp "packages/$spec_file" "$WORKDIR"
cp -rp ".rpmpkg" "$WORKDIR/${{ env.APP_NAME }}"
cd "$WORKDIR"
# Prepare spec file for RPM
sed -i 's/{{ NAME }}/${{ env.APP_NAME }}/g' $spec_file
sed -i 's/{{ VERSION }}/${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}/g' $spec_file
sed -i 's/{{ MAINTAINER }}/${{ env.MAINTAINER }}/g' $spec_file
sed -i 's/{{ DESC }}/${{ env.DESC }}/g' $spec_file
sed -i 's/{{ ARCH }}/x86_64/g' $spec_file
# sed -i "s@{{ POSTRUN }}@$(<packages/postrun)@g" $spec_file
tar czf tmp.tar.gz "${{ env.APP_NAME }}/"
mkdir -p "$RPMBUILD_SOURCE_DIR"
mkdir -p "$RPMBUILD_SPEC_DIR"
mv tmp.tar.gz "$RPMBUILD_SOURCE_DIR"
cp -p $spec_file "$RPMBUILD_SPEC_DIR"
rpmbuild -bb "$RPMBUILD_SPEC_DIR/$spec_file"
ls -lah "$RPMBUILD_DIR/RPMS/x86_64"/*.rpm
cp -p "$RPMBUILD_DIR/RPMS/x86_64"/*.rpm $GITHUB_WORKSPACE
- name: Rename packages to proper name
run: |
version=${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}
rpm_path="./${{ env.APP_NAME }}-${version}-1.x86_64.rpm"
cp $rpm_path "./${{ env.APP_NAME }}-${version}-1.el7.x86_64.rpm"
cp $rpm_path "./${{ env.APP_NAME }}-${version}-1.el8.x86_64.rpm"
mv $rpm_path "./${{ env.APP_NAME }}-${version}-1.el9.x86_64.rpm"
mkdir -p ./artifacts
mv *.deb ./artifacts/
mv *.rpm ./artifacts/
ls -lah ./artifacts/*.deb
ls -lah ./artifacts/*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-deb-amd64
path: ./artifacts/*.deb
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el7-amd64
path: ./artifacts/*.el7.*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el8-amd64
path: ./artifacts/*.el8.*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el9-amd64
path: ./artifacts/*.el9.*.rpm
build-linux-packages-arm64:
needs:
- vars
- build-artifact
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: manticoresoftware/download_artifact_with_retries@main
with:
name: artifact-ubuntu-22.04-arm64
path: .
- name: Prepare package
run: |
# name is like assets manticore-executor_v0.5.1-221214-e089052_linux_arm64:
tar -xzf *.tar.gz
# Setup openssl workaround
mkdir -p .debpkg/DEBIAN
cp -p packages/postrun .debpkg/DEBIAN/postinst
mkdir -p .debpkg/usr/bin
mkdir -p .rpmpkg/usr/bin
mkdir -p .rpmpkg/usr/share
cp -p *_linux_arm64/${{ env.APP_NAME }} .debpkg/usr/bin/${{ env.APP_NAME }}
cp -p *_linux_arm64/${{ env.APP_NAME }} .rpmpkg/usr/bin/${{ env.APP_NAME }}
cp -p LICENSE .rpmpkg/usr/share/${{ env.APP_NAME }}-LICENSE
cp -p README.md .rpmpkg/usr/share/${{ env.APP_NAME }}-README.md
- uses: manticoresoftware/actions-build-deb-action@master
with:
package: ${{ env.APP_NAME }}
package_root: .debpkg
maintainer: ${{ env.MAINTAINER }}
version: ${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.deb_suffix }}
arch: 'arm64'
desc: '${{ env.DESC }}'
license: 'PHP-3.01'
- name: Rename package to proper name
run: |
mkdir -p ./artifacts
mv *.deb ./artifacts
ls -lah ./artifacts/*.deb
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-deb-arm64
path: ./artifacts/*.deb
- uses: manticoresoftware/actions-run-on-arch-action@master
name: Preparing EL7 RPM package
with:
arch: aarch64
distro: centos7
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/artifacts/packages"
cp -rp .rpmpkg "${PWD}/artifacts/.rpmpkg"
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
install: |
yum install -y sudo git kernel-devel kernel-headers
yum groupinstall -y "Development Tools"
run: |
RPMBUILD_DIR="$HOME/rpmbuild"
RPMBUILD_SOURCE_DIR="$RPMBUILD_DIR/SOURCES"
RPMBUILD_SPEC_DIR="$RPMBUILD_DIR/SPECS"
WORKDIR="/tmp/work"
mkdir "$WORKDIR"
spec_file=main.spec
cp "packages/$spec_file" "$WORKDIR"
cp -rp "/artifacts/.rpmpkg" "$WORKDIR/${{ env.APP_NAME }}"
cd "$WORKDIR"
# Prepare spec file for RPM
sed -i 's/{{ NAME }}/${{ env.APP_NAME }}/g' $spec_file
sed -i 's/{{ VERSION }}/${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}/g' $spec_file
sed -i 's/{{ MAINTAINER }}/${{ env.MAINTAINER }}/g' $spec_file
sed -i 's/{{ DESC }}/${{ env.DESC }}/g' $spec_file
sed -i 's/{{ ARCH }}/aarch64/g' $spec_file
# sed -i "s@{{ POSTRUN }}@$(<packages/postrun)@g" $spec_file
tar czf tmp.tar.gz "${{ env.APP_NAME }}/"
mkdir -p "$RPMBUILD_SOURCE_DIR"
mkdir -p "$RPMBUILD_SPEC_DIR"
mv tmp.tar.gz "$RPMBUILD_SOURCE_DIR"
cp -p $spec_file "$RPMBUILD_SPEC_DIR"
rpmbuild -bb "$RPMBUILD_SPEC_DIR/$spec_file"
cp -p "$RPMBUILD_DIR/RPMS/$(uname -m)"/*.rpm /artifacts/
- name: Rename package to proper name
run: |
ls -lah ./artifacts/*.rpm
version=${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}
rpm_path="./artifacts/${{ env.APP_NAME }}-${version}-1.el7.aarch64.rpm"
cp $rpm_path "./artifacts/${{ env.APP_NAME }}-${version}-1.el8.aarch64.rpm"
cp $rpm_path "./artifacts/${{ env.APP_NAME }}-${version}-1.el9.aarch64.rpm"
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el7-aarch64
path: ./artifacts/*.el7.*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el8-aarch64
path: ./artifacts/*.el8.*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-rpm-el9-aarch64
path: ./artifacts/*.el9.*.rpm
build-extra-packages:
runs-on: ubuntu-22.04
needs:
- vars
steps:
- uses: actions/checkout@v3
- name: Prepare packages structure
run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/share/manticore
mkdir -p .rpmpkg/usr/bin
mkdir -p .rpmpkg/usr/share/manticore
cp -p extra.notice .debpkg/usr/share/manticore/${{ env.EXTRA_NAME }}.notice
cp -p extra.notice .rpmpkg/usr/share/manticore/${{ env.EXTRA_NAME }}.notice
echo "" > .rpmpkg/usr/share/${{ env.EXTRA_NAME }}-LICENSE
- uses: manticoresoftware/actions-build-deb-action@master
name: Build DEB packages
with:
package: ${{ env.EXTRA_NAME }}
package_root: .debpkg
maintainer: ${{ env.MAINTAINER }}
version: ${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.deb_suffix }}
arch: 'all'
desc: '${{ env.EXTRA_DESC }}'
license: 'Apache-2.0'
depends: '${{ env.APP_NAME }} (>= ${{ needs.vars.outputs.app_version }}), ${{ env.COLUMNAR_NAME }} (>= ${{ env.COLUMNAR_VERSION }}), ${{ env.GALERA_NAME }} (>= ${{ env.GALERA_VERSION }}), ca-certificates'
- name: Build RPM packages
run: |
sudo apt-get update -y -q
sudo apt-get install -y rpm
RPMBUILD_DIR="$HOME/rpmbuild"
RPMBUILD_SOURCE_DIR="$RPMBUILD_DIR/SOURCES"
RPMBUILD_SPEC_DIR="$RPMBUILD_DIR/SPECS"
WORKDIR="/tmp/work"
mkdir "$WORKDIR"
spec_file=extra.spec
cp "packages/$spec_file" "$WORKDIR"
cp -rp ".rpmpkg" "$WORKDIR/${{ env.EXTRA_NAME }}"
cd "$WORKDIR"
# Prepare spec file for RPM
sed -i 's/{{ NAME }}/${{ env.EXTRA_NAME }}/g' $spec_file
sed -i 's/{{ VERSION }}/${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}/g' $spec_file
sed -i 's/{{ MAINTAINER }}/${{ env.MAINTAINER }}/g' $spec_file
sed -i 's/{{ DESC }}/${{ env.EXTRA_DESC }}/g' $spec_file
sed -i 's/{{ EXECUTOR_NAME }}/${{ env.APP_NAME }}/g' $spec_file
sed -i 's/{{ EXECUTOR_VERSION }}/${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}/g' $spec_file
sed -i 's/{{ COLUMNAR_NAME }}/${{ env.COLUMNAR_NAME }}/g' $spec_file
sed -i 's/{{ COLUMNAR_VERSION }}/${{ env.COLUMNAR_VERSION }}/g' $spec_file
sed -i 's/{{ GALERA_NAME }}/${{ env.GALERA_NAME }}/g' $spec_file
sed -i 's/{{ GALERA_VERSION }}/${{ env.GALERA_VERSION }}/g' $spec_file
tar czf tmp.tar.gz "${{ env.EXTRA_NAME }}/"
mkdir -p "$RPMBUILD_SOURCE_DIR"
mkdir -p "$RPMBUILD_SPEC_DIR"
mv tmp.tar.gz "$RPMBUILD_SOURCE_DIR"
cp -p $spec_file "$RPMBUILD_SPEC_DIR"
rpmbuild -bb "$RPMBUILD_SPEC_DIR/$spec_file"
ls -lah "$RPMBUILD_DIR/RPMS/noarch"/*.rpm
cp -p "$RPMBUILD_DIR/RPMS/noarch"/*.rpm $GITHUB_WORKSPACE
- name: Rename packages to proper name
run: |
version=${{ needs.vars.outputs.app_version }}${{ needs.vars.outputs.rpm_suffix }}
rpm_path="./${{ env.EXTRA_NAME }}-${version}-1.noarch.rpm"
cp $rpm_path "./${{ env.EXTRA_NAME }}-${version}-1.el7.noarch.rpm"
cp $rpm_path "./${{ env.EXTRA_NAME }}-${version}-1.el8.noarch.rpm"
mv $rpm_path "./${{ env.EXTRA_NAME }}-${version}-1.el9.noarch.rpm"
mkdir -p ./artifacts
mv *.deb ./artifacts/
mv *.rpm ./artifacts/
ls -lah ./artifacts/*.deb
ls -lah ./artifacts/*.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-extra-deb
path: ./artifacts/*.deb
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-extra-rpm-el7
path: ./artifacts/*.el7.noarch.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-extra-rpm-el8
path: ./artifacts/*.el8.noarch.rpm
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: artifact-extra-rpm-el9
path: ./artifacts/*.el9.noarch.rpm
create-release:
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
repository-projects: write
needs:
- build-artifact
- build-artifact-dev
- build-linux-packages
- build-linux-packages-arm64
- build-extra-packages
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate changelog
run: |
curl -sSL https://github.com/git-chglog/git-chglog/releases/download/v0.15.1/git-chglog_0.15.1_linux_amd64.tar.gz | tar -xzf -
chmod +x git-chglog
./git-chglog --output ./CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: ./CHANGELOG.md
draft: false
prerelease: true
- name: Write upload_url to file
run: echo '${{ steps.create-release.outputs.upload_url }}' > upload_url.txt
- uses: manticoresoftware/upload_artifact_with_retries@main
with:
name: create-release
path: upload_url.txt
upload-release:
runs-on: ubuntu-22.04
needs: create-release
strategy:
matrix:
include:
- artifact_suffix: ubuntu-22.04-amd64
asset_name_suffix: linux_amd64.tar.gz
asset_content_type: application/gzip
- artifact_suffix: ubuntu-22.04-arm64
asset_name_suffix: linux_arm64.tar.gz
asset_content_type: application/gzip
- artifact_suffix: macos-13-x86_64
asset_name_suffix: macos_x86_64.tar.gz
asset_content_type: application/gzip
- artifact_suffix: macos-14-arm64
asset_name_suffix: macos_arm64.tar.gz
asset_content_type: application/gzip
- artifact_suffix: dev-ubuntu-22.04-amd64
asset_name_suffix: linux_amd64-dev.tar.gz
asset_content_type: application/gzip
steps:
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: artifact-${{ matrix.artifact_suffix }}
path: .
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: create-release
path: .
- id: vars
run: |
echo "upload_url=$(cat upload_url.txt)" >> $GITHUB_OUTPUT
echo "asset_path=$(ls *${{ matrix.asset_name_suffix }} | head -n 1)" >> $GITHUB_OUTPUT
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.vars.outputs.upload_url }}
asset_path: ${{ steps.vars.outputs.asset_path }}
asset_name: ${{ steps.vars.outputs.asset_path }}
asset_content_type: ${{ matrix.asset_content_type }}
upload-linux-packages:
runs-on: ubuntu-22.04
needs: create-release
strategy:
matrix:
include:
- pkg: deb
suffix: "amd64"
asset_content_type: application/vnd.debian.binary-package
- pkg: deb
suffix: "arm64"
asset_content_type: application/vnd.debian.binary-package
- pkg: rpm
suffix: "el7-amd64"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "el8-amd64"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "el9-amd64"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "el7-aarch64"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "el8-aarch64"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "el9-aarch64"
asset_content_type: application/x-rpm
steps:
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: artifact-${{ matrix.pkg }}-${{ matrix.suffix }}
path: .
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: create-release
path: .
- id: vars
run: |
asset_path=$(ls ./artifacts/*.${{ matrix.pkg }} | head -n 1)
echo "upload_url=$(cat upload_url.txt)" >> $GITHUB_OUTPUT
echo "asset_path=$asset_path" >> $GITHUB_OUTPUT
echo "asset_name=$(basename $asset_path)" >> $GITHUB_OUTPUT
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.vars.outputs.upload_url }}
asset_path: ${{ steps.vars.outputs.asset_path }}
asset_name: ${{ steps.vars.outputs.asset_name }}
asset_content_type: ${{ matrix.asset_content_type }}
upload-extra-packages:
runs-on: ubuntu-22.04
needs: create-release
strategy:
matrix:
include:
- pkg: deb
suffix: ""
asset_content_type: application/vnd.debian.binary-package
- pkg: rpm
suffix: "-el7"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "-el8"
asset_content_type: application/x-rpm
- pkg: rpm
suffix: "-el9"
asset_content_type: application/x-rpm
steps:
# We download amd64 only but just because of noarch
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: artifact-extra-${{ matrix.pkg }}${{ matrix.suffix }}
path: .
- uses: manticoresoftware/download_artifact_with_retries@main
with:
name: create-release
path: .
- name: Prepare package names
run: |
file=$(ls ./artifacts/*.${{ matrix.pkg }} | head -n 1)
mv "$file" artifact
rm -f *.${{ matrix.pkg }}
file=${file/amd64/all}
file=${file/x86_64/noarch}
mv artifact "$file"
shell: bash
- id: vars
run: |
asset_path=$(ls ./artifacts/*.${{ matrix.pkg }} | head -n 1)
echo "upload_url=$(cat upload_url.txt)" >> $GITHUB_OUTPUT
echo "asset_path=$asset_path" >> $GITHUB_OUTPUT
echo "asset_name=$(basename $asset_path)" >> $GITHUB_OUTPUT
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.vars.outputs.upload_url }}
asset_path: ${{ steps.vars.outputs.asset_path }}
asset_name: ${{ steps.vars.outputs.asset_name }}
asset_content_type: ${{ matrix.asset_content_type }}
deploy:
needs:
- upload-release
- upload-linux-packages
- upload-extra-packages
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: buster
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: buster
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: bionic
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: bionic
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: focal
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: focal
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: jammy
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: jammy
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: bullseye
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: bullseye
- artifact: artifact-deb-amd64
type: deb
arch: amd64
delimiter: "-"
distro: bookworm
- artifact: artifact-deb-arm64
type: deb
arch: arm64
delimiter: "-"
distro: bookworm
- artifact: artifact-rpm-el7-amd64
type: rpm
arch: x86_64
delimiter: "_"
distro: 7
- artifact: artifact-rpm-el7-aarch64
type: rpm
arch: aarch
delimiter: "_"
distro: 7
- artifact: artifact-rpm-el8-amd64
type: rpm
arch: x86_64
delimiter: "_"
distro: 8
- artifact: artifact-rpm-el8-aarch64
type: rpm
arch: aarch
delimiter: "_"
distro: 8
- artifact: artifact-rpm-el9-amd64
type: rpm
arch: x86_64
delimiter: "_"
distro: 9
- artifact: artifact-rpm-el9-aarch64
type: rpm
arch: aarch
delimiter: "_"
distro: 9
- artifact: artifact-macos-13-x86_64
type: arc
arch: x86_64
delimiter: "-"
distro: ""
- artifact: artifact-macos-14-arm64
type: arc
arch: aarch
delimiter: "-"
distro: ""
# manticore-extra meta package now
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: buster
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: bionic
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: focal
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: jammy
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: bullseye
- artifact: artifact-extra-deb
type: deb
arch: all
delimiter: "-"
distro: bookworm
- artifact: artifact-extra-rpm-el7
type: rpm
arch: noarch
delimiter: "_"
distro: 7
- artifact: artifact-extra-rpm-el8
type: rpm
arch: noarch
delimiter: "_"
distro: 8
- artifact: artifact-extra-rpm-el9
type: rpm
arch: noarch
delimiter: "_"
distro: 9
steps:
- name: Deploy package
uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: ${{ matrix.distro }}
arch: ${{ matrix.arch }}
artifact: ${{ matrix.artifact }}
type: ${{ matrix.type }}
delimiter: ${{ matrix.delimiter }}
deploy-docker:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs:
- vars
- deploy
strategy:
matrix:
include:
- name: Deploy docker amd64
arch: amd64
os: ubuntu-22.04
- name: Deploy docker arm64
arch: arm64
os: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile-dist
platforms: linux/amd64, linux/arm64
load: false
push: true
tags: ${{ env.DOCKER_TAG }}:${{ needs.vars.outputs.app_version }}
update-manticoresearch-deps:
needs:
- vars
- deploy
runs-on: ubuntu-22.04
steps:
- name: Update deps
uses: manticoresoftware/manticoresearch/actions/update-deps@master
with:
name: executor
version: "${{ needs.vars.outputs.app_version }} ${{ needs.vars.outputs.app_date }} ${{ needs.vars.outputs.app_commit }}"
token: ${{ secrets.PR_TOKEN }}