-
Notifications
You must be signed in to change notification settings - Fork 32
531 lines (447 loc) · 16 KB
/
build.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
name: Perl application
on:
push:
tags:
- "v*.*.*"
jobs:
centos7:
runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: make dir
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/dxperlcent7:5.26
with:
ENCKEY: ${{ secrets.ENCKEY }}
- name: Get the version
id: get_version
run: |
SOURCE_TAG=${GITHUB_REF#refs/tags/}
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat7-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload centos 7
uses: actions/upload-artifact@v1
with:
name: cento7build
path: ${{ env.FILENAME }}
docker:
needs: [centos7]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: pioro/dxtoolkit
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: docker/
push: true
tags: ${{ steps.meta.outputs.tags }}
ubuntu:
needs: [centos7]
runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: make dir
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/dxperlubuntu18:5.26
with:
ENCKEY: ${{ secrets.ENCKEY }}
- name: Get the version
id: get_version
run: |
SOURCE_TAG=${GITHUB_REF#refs/tags/}
FILENAME="dxtoolkit2-${SOURCE_TAG}-ubuntu1804-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload ubuntu
uses: actions/upload-artifact@v1
with:
name: ubuntubuild
path: ${{ env.FILENAME }}
centos6:
needs: [centos7]
runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: make dir
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/dxperlcent6:5.26
with:
ENCKEY: ${{ secrets.ENCKEY }}
- name: Get the version
id: get_version
run: |
SOURCE_TAG=${GITHUB_REF#refs/tags/}
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat6-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload centos 6
uses: actions/upload-artifact@v1
with:
name: cento6build
path: ${{ env.FILENAME }}
oel8:
needs: [centos7]
runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: make dir
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/dxperloel8:5.26
with:
ENCKEY: ${{ secrets.ENCKEY }}
- name: Get the version
id: get_version
run: |
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/tags/}
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/heads/}
else
exit 1
fi
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat8-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload oel 8
uses: actions/upload-artifact@v1
with:
name: oel8build
path: ${{ env.FILENAME }}
Windows:
needs: [centos7]
runs-on: windows-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: Get the version
id: get_version
run: |
$SOURCE_TAG = ${env:GITHUB_REF} -replace 'refs\/tags\/', ''
$FILENAME="dxtoolkit2-" + $SOURCE_TAG + "-win64-installer.zip"
echo "SOURCE_TAG=$SOURCE_TAG" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "FILENAME=$FILENAME" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: powershell
- name: Fix encryption key
run: |
cd D:\a\dxtoolkit\dxtoolkit\lib
ls -l dbutils.pm
mv dbutils.pm dbutils.orig.pm
$raw = (Get-Content -path .\dbutils.orig.pm -Raw) -replace 'put your encryption key here','${{ secrets.ENCKEY_WINDOWS }}'
Set-Content -Path .\dbutils.pm -Value $raw
cd D:\a\dxtoolkit\dxtoolkit\
shell: powershell
- name: download perl
run: |
mkdir d:\a\perldownload
mkdir d:\a\perl
choco install wget -y
cd d:\a\perldownload
wget.exe "http://strawberryperl.com/download/5.26.3.1/strawberry-perl-5.26.3.1-64bit-portable.zip"
dir d:\a\perldownload\
Expand-Archive "d:\a\perldownload\strawberry-perl-5.26.3.1-64bit-portable.zip" -DestinationPath "d:\a\perl"
shell: powershell
- name: build
run: build\windows_compile.cmd
shell: cmd
- name: add examples
run: |
copy D:\a\dxtoolkit\dxtoolkit\bin\dxtools.conf.example d:\a\dxtoolkit\dxtoolkit\dxtoolkit2
copy D:\a\dxtoolkit\dxtoolkit\bin\dxusers.csv.example d:\a\dxtoolkit\dxtoolkit\dxtoolkit2
- name: compress toolkit
run: |
$NAME = "d:\a\dxtoolkit\dxtoolkit\${{ env.FILENAME }}"
echo ${NAME}
Compress-Archive -Path d:\a\dxtoolkit\dxtoolkit\dxtoolkit2 -DestinationPath ${NAME}
shell: powershell
- name: Upload windows
uses: actions/upload-artifact@v1
with:
name: windowsbuild
path: ${{ env.FILENAME }}
osx:
needs: [centos7]
runs-on: macos-11
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: Get the version
id: get_version
run: |
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/tags/}
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/heads/}
else
exit 1
fi
FILENAME="dxtoolkit2-${SOURCE_TAG}-osx.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: install perl
run: |
# have a static version of perl 5.30.2_1
#brew uninstall --ignore-dependencies perl
#brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
#brew install pioro/repo/[email protected]
#brew install cpanminus
CELL=`brew --prefix perl`
$CELL/bin/perl -MCPAN -e 'install App::cpanminus'
#brew install [email protected]
$CELL/bin/cpanm Crypt::[email protected]
$CELL/bin/cpanm Crypt::Blowfish
# export OPENSSL_PREFIX=`brew --prefix [email protected]`
# echo $OPENSSL_PREFIX
# export LIBS="-d=$OPENSSL_PREFIX"
# $CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
$CELL/bin/cpanm Filter::Crypto::Decrypt
$CELL/bin/cpanm JSON
$CELL/bin/cpanm Date::Manip
# force requires after 1/1/2020 ?
$CELL/bin/cpanm -f Date::Parse
$CELL/bin/cpanm DateTime::Event::Cron::Quartz
$CELL/bin/cpanm DateTime::Format::DateParse
$CELL/bin/cpanm Text::CSV
$CELL/bin/cpanm LWP::UserAgent
$CELL/bin/cpanm --force Net::SSLeay
$CELL/bin/cpanm Mozilla::CA@20180117
$CELL/bin/cpanm -f IO::Socket::[email protected]
$CELL/bin/cpanm LWP::Protocol::https
$CELL/bin/cpanm Term::ReadKey
$CELL/bin/cpanm -f Archive::Zip
$CELL/bin/cpanm utf8
$CELL/bin/cpanm PAR::Packer
$CELL/bin/cpanm List::MoreUtils::PP
- name: Compile
run: |
#CELL=`brew --prefix pioro/repo/[email protected]`
CELL=`brew --prefix perl`
OPENLIB=`brew --prefix openssl@3`
CDIR=`pwd`
export PP=${CELL}/bin/pp
export LIBS="-l ${OPENLIB}/lib/libssl.dylib -l ${OPENLIB}/lib/libcrypto.dylib"
echo $LIBS
mkdir dxtoolkit2
cd ./lib
mv dbutils.pm dbutils.orig.pm
cat dbutils.orig.pm | sed -e "s/put your encryption key here/${{ secrets.ENCKEY }}/" > dbutils.pm
cd ../bin
$PP -u -I ../lib ${LIBS} -M Text::CSV_PP -M List::MoreUtils::PP -M Crypt::Blowfish \
-F Crypto=dbutils\.pm$ -M Filter::Crypto::Decrypt -o ../dxtoolkit2/runner `ls dx_*.pl | xargs`
cd ${CDIR}/dxtoolkit2
#for i in ${CDIR}/bin/dx_*.pl ; do name=`basename -s .pl $i`; ln -s runner $name; done
echo #!/bin/bash > install.sh
echo LIST_OF_SCRIPTS=\( >> install.sh
for i in ${CDIR}/bin/dx_*.pl ; do
name=`basename -s .pl $i`;
echo $name >> install.sh
done
echo \) >> install.sh
echo >> install.sh
echo >> install.sh
echo for i in \"\$\{LIST_OF_SCRIPTS\[\@\]\}\" >> install.sh
echo do >> install.sh
echo echo \$i >> install.sh
echo ln -sf runner \$i >> install.sh
echo done >> install.sh
cp ${CDIR}/bin/dxtools.conf.example ${CDIR}/bin/dxusers.csv.example ${CDIR}/dxtoolkit2
cd ${CDIR}
ls -l ./dxtoolkit2
tar czvf ${{ env.FILENAME }} dxtoolkit2/
- name: Upload OSX
uses: actions/upload-artifact@v1
with:
name: osxbuild
path: ${{ env.FILENAME }}
amazon2023:
needs: [centos7]
runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master
- name: add version
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
cd ./lib
mv Toolkit_helpers.pm Toolkit_helpers.orig.pm
cat Toolkit_helpers.orig.pm | sed -r -e "s/([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.?[[:digit:]]?)/\1-dev-${GITHUB_SHA}/" > Toolkit_helpers.pm
grep "version" Toolkit_helpers.pm
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/pioroamazon:2023
with:
ENCKEY: ${{ secrets.ENCKEY }}
- name: Get the version
id: get_version
run: |
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/tags/}
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/heads/}
else
exit 1
fi
FILENAME="dxtoolkit2-${SOURCE_TAG}-amazon2023-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
ls -l
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload amazon 2023
uses: actions/upload-artifact@v1
with:
name: amazon2023
path: ${{ env.FILENAME }}
release:
runs-on: ubuntu-latest
needs: [centos6, centos7, windows, ubuntu, osx, amazon2023, oel8, docker]
permissions:
contents: write
steps:
- name: Download centos7
uses: actions/download-artifact@v1
with:
name: cento7build
- name: Download centos6
uses: actions/download-artifact@v1
with:
name: cento6build
- name: Download windows
uses: actions/download-artifact@v1
with:
name: windowsbuild
- name: Download ubuntu
uses: actions/download-artifact@v1
with:
name: ubuntubuild
- name: Download osx
uses: actions/download-artifact@v1
with:
name: osxbuild
- name: Download OEL8
uses: actions/download-artifact@v1
with:
name: oel8build
- name: Download Amazon 2023
uses: actions/download-artifact@v1
with:
name: amazon2023
- name: Say
run: |
echo "HELLO"
ls -l
ls -lR
- name: Get the version
id: get_version
run: |
SOURCE_TAG=${GITHUB_REF#refs/tags/}
FILENAMERH7="dxtoolkit2-${SOURCE_TAG}-redhat7-installer.tar.gz"
FILENAMERH8="dxtoolkit2-${SOURCE_TAG}-redhat8-installer.tar.gz"
FILENAMERH6="dxtoolkit2-${SOURCE_TAG}-redhat6-installer.tar.gz"
FILENAMEUBUNTU="dxtoolkit2-${SOURCE_TAG}-ubuntu1804-installer.tar.gz"
FILENAMEWIN="dxtoolkit2-${SOURCE_TAG}-win64-installer.zip"
FILENAMEOSX="dxtoolkit2-${SOURCE_TAG}-osx.tar.gz"
FILENAMEAMZ="dxtoolkit2-${SOURCE_TAG}-amazon2023-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAMERH7=$FILENAMERH7 >> $GITHUB_ENV
echo FILENAMERH6=$FILENAMERH6 >> $GITHUB_ENV
echo FILENAMERH8=$FILENAMERH8 >> $GITHUB_ENV
echo FILENAMEUBUNTU=$FILENAMEUBUNTU >> $GITHUB_ENV
echo FILENAMEWIN=$FILENAMEWIN >> $GITHUB_ENV
echo FILENAMEOSX=$FILENAMEOSX >> $GITHUB_ENV
echo FILENAMEAMZ=$FILENAMEAMZ >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ env.SOURCE_TAG }}
draft: true
prerelease: true
artifacts: "cento7build/${{ env.FILENAMERH7 }},cento6build/${{ env.FILENAMERH6 }},oel8build/${{ env.FILENAMERH8 }},ubuntubuild/${{ env.FILENAMEUBUNTU }},windowsbuild/${{ env.FILENAMEWIN }},osxbuild/${{ env.FILENAMEOSX }},amazon2023/${{ env.FILENAMEAMZ }}"
tag: ${{ env.SOURCE_TAG }}