-
Notifications
You must be signed in to change notification settings - Fork 1
705 lines (633 loc) · 24.6 KB
/
cmake.yml
File metadata and controls
705 lines (633 loc) · 24.6 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
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
name: CMake
on:
push:
branches:
- master
env:
BUILD_TYPE: Release
BOOST_VERSION: 1.81.0
PROTO_VERSION: 21.10
jobs:
build:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
include:
- os: ubuntu-20.04
os_version: 20.04
build_tool: gcc
- os: ubuntu-22.04
os_version: 22.04
build_tool: gcc
- os: windows-2019
os_version: 2019
build_tool: msvc142
runs-on: ${{ matrix.os }}
permissions:
contents: write
packages: write
outputs:
release_version: ${{ steps.configure-ubuntu.outputs.release_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: HeartlandSoftware/date
path: open/date
token: ${{ secrets.HSS_PAT }}
- uses: actions/checkout@v3
with:
repository: BertoldVdb/ZoneDetect
path: open/ZoneDetect
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel include files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc include files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread include files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Math include files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography include files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "includes.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Math protobuf files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "proto_def.zip"
tarBall: false
zipBall: false
out-file-path: "proto/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography protobuf files
uses: robinraju/release-downloader@v1.7
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "proto_def.zip"
tarBall: false
zipBall: false
out-file-path: "proto/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "windows.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "ubuntu20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download LowLevel lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_LowLevel"
latest: true
fileName: "ubuntu22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_LowLevel"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "windows.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "ubuntu20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download ErrorCalc lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/ErrorCalc2"
latest: true
fileName: "ubuntu22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/ErrorCalc"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Multithread lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Multithread2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Multithread"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Math lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Math_2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Math"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'windows-2019'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Windows-2019.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-20.04'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Ubuntu-20.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Download Geography lib
uses: robinraju/release-downloader@v1.7
if: matrix.os == 'ubuntu-22.04'
with:
repository: "HeartlandSoftware/HSS_Geography_2"
latest: true
fileName: "lib-Ubuntu-22.04.zip"
tarBall: false
zipBall: false
out-file-path: "cxx/dlibs/HSS_Geography"
token: ${{ secrets.HSS_PAT }}
- name: Bundle Protobuf Files
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: Compress-Archive -Path proto -DestinationPath proto_def.zip
- name: Download prebuilt timezone code
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/Ef53CoBK3MFAlzYm4Lw7VOMBZ62KRxLsSGYPz4_XamvvWw?e=b8zdy0&download=1" -OutFile timezones.zip
Expand-Archive timezones.zip -DestinationPath timezones
- name: Unarchive downloaded include files
shell: pwsh
run: |
Expand-Archive proto/HSS_Math/proto_def.zip -DestinationPath . -Force
Expand-Archive proto/HSS_Geography/proto_def.zip -DestinationPath . -Force
cd cxx
Expand-Archive ErrorCalc/includes.zip -DestinationPath ErrorCalc
Expand-Archive HSS_LowLevel/includes.zip -DestinationPath HSS_LowLevel
Expand-Archive HSS_Multithread/includes.zip -DestinationPath HSS_Multithread
Expand-Archive HSS_Math/includes.zip -DestinationPath HSS_Math
Expand-Archive HSS_Geography/includes.zip -DestinationPath HSS_Geography
New-Item include/open/date/include/date -ItemType Directory -ea 0
Copy-Item ../open/date/include/date/*.h include/open/date/include/date
New-Item include/library -ItemType Directory -ea 0
Copy-Item ../open/ZoneDetect/library/zonedetect.h include/library
New-Item src/tz -ItemType Directory -ea 0
Copy-Item ../open/date/src/tz.cpp src/tz
Copy-Item ../open/ZoneDetect/library/zonedetect.c src
New-Item src/open/tzdb-2021e-src -ItemType Directory -ea 0
Copy-Item timezones/country/* src/open/tzdb-2021e-src
New-Item include/open/out_v1 -ItemType Directory -ea 0
Copy-Item timezones/out_v1/*.h include/open/out_v1
New-Item src/open/out_v1 -ItemType Directory -ea 0
Copy-Item timezones/out_v1/*.c src/open/out_v1
- name: Unarchive downloaded Windows libraries
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Windows-2019.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/windows.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/windows.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Windows-2019.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Windows-2019.zip -DestinationPath dlibs
- name: Unarchive downloaded Ubuntu libraries
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Ubuntu-20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/ubuntu20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/ubuntu20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Ubuntu-20.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Ubuntu-20.04.zip -DestinationPath dlibs
- name: Unarchive downloaded Ubuntu libraries
if: matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
Expand-Archive dlibs/HSS_Multithread/lib-Ubuntu-22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/ErrorCalc/ubuntu22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_LowLevel/ubuntu22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Math/lib-Ubuntu-22.04.zip -DestinationPath dlibs
Expand-Archive dlibs/HSS_Geography/lib-Ubuntu-22.04.zip -DestinationPath dlibs
- name: Set up JDK 8
uses: actions/setup-java@v2
if: matrix.os == 'ubuntu-22.04'
with:
java-version: '8'
distribution: 'temurin'
server-id: github
cache: 'maven'
# Retrieve the cache, uses cache@v3
- name: Cache boost
uses: actions/cache@v3
id: cache-boost
with:
# Set the default path as the path to cache
path: '${{ runner.workspace }}/boost_*.tar.gz'
# Use the version as the key to only cache the correct version
key: boost-${{ env.BOOST_VERSION }}
- name: Install boost
uses: egor-tensin/build-boost@v1
id: install-boost
with:
version: ${{ env.BOOST_VERSION }}
toolset: ${{ matrix.build_tool }}
libraries: system chrono
- name: Setup Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
sudo apt install libgtest-dev libgdal-dev
- name: Build zlib
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EUYThUR24ZZHq6GaiJ7fPFsBeilVSYM_agJV1Y8FTlJS0g?e=e3Nrmn&download=1" -OutFile zlib.zip
Expand-Archive zlib.zip -DestinationPath zlib
mv zlib/zlib-1.2.13/* zlib
cd zlib
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install ../
cmake --build . --config Release
cmake --install .
- name: Download protobuf
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EUZ4knsEFP5FjNHHWR5dHc0BofAFyEPdLKRvzAgaTuDi1w?e=XW0Muc&download=1" -OutFile protobuf.zip
Expand-Archive protobuf.zip -DestinationPath protobuf
mv protobuf/protobuf-3.${{ env.PROTO_VERSION }}/* protobuf
- name: Build protobuf
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
cd protobuf
cd cmake
mkdir build
cd build
$zlibpath = Resolve-Path -path ../../../zlib/build/install
cmake -Dprotobuf_WITH_ZLIB=ON -DZLIB_ROOT="$zlibpath" -Dprotobuf_BUILD_SHARED_LIBS=ON ../
cmake --build . --config Release --target libprotobuf
cmake --build . --config Release --target protoc
Copy-Item $zlibpath/bin/* Release
Copy-Item $zlibpath/lib/* Release
- name: Build protobuf
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
cd protobuf
cd cmake
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build . --target libprotobuf
cmake --build . --target protoc
- name: Build Proto definition files
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
./cxx/protobuf/cmake/build/protoc --java_out java/src/main/java --cpp_out=dllexport_decl=TIMES_API:proto --proto_path proto/ --proto_path cxx/protobuf/src wtime.proto
Move-Item proto/*.pb.cc -Destination cxx/src/generated -force
(Get-Content -path proto/wtime.pb.h -Raw) -replace '#include <string>',"#include <string>`n#include `"internal/times_internal.h`"" | Set-Content -Path proto/wtime.pb.h
Move-Item proto/*.pb.h -Destination cxx/include -force
- name: Build Proto definition files
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
./cxx/protobuf/cmake/build/Release/protoc --cpp_out=dllexport_decl=TIMES_API:proto --proto_path proto/ --proto_path cxx/protobuf/src wtime.proto
Move-Item proto/*.pb.cc -Destination cxx/src/generated -force
(Get-Content -path proto/wtime.pb.h -Raw) -replace '#include <string>',"#include <string>`n#include `"internal/times_internal.h`"" | Set-Content -Path proto/wtime.pb.h
Move-Item proto/*.pb.h -Destination cxx/include -force
- name: Bundle Include Files
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -Path include -DestinationPath includes.zip
mv includes.zip ..
- name: Upload Include Bundle
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: |
includes.zip
proto_def.zip
retention-days: 1
- name: Configure CMake Ubuntu
id: configure-ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx
mkdir build
cd build
mkdir ubuntu
cd ubuntu
cmake ../.. -DBOOST_INCLUDE_DIR=${{ steps.install-boost.outputs.root }} -DLOWLEVEL_INCLUDE_DIR=HSS_LowLevel/include -DTHIRD_PARTY_INCLUDE_DIR=HSS_LowLevel/third_party -DMULTITHREAD_INCLUDE_DIR=HSS_Multithread/include -DERROR_CALC_INCLUDE_DIR=ErrorCalc/include -DMATH_INCLUDE_DIR=HSS_Math/include -DGEOGRAPHY_INCLUDE_DIR=HSS_Geography/include -DPROTOBUF_INCLUDE_DIR=protobuf/src -DLOCAL_LIBRARY_DIR=dlibs -DPROTOBUF_LIBRARY_DIR=protobuf/cmake/build -DGDAL_INCLUDE_DIR=/usr/include/gdal -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
APPLICATION_VERSION=$(grep CMAKE_PROJECT_VERSION: CMakeCache.txt | cut -d "=" -f2)
APPLICATION_VERSION_MAJOR=$(grep CMAKE_PROJECT_VERSION_MAJOR: CMakeCache.txt | cut -d "=" -f2)
echo "release_version=$APPLICATION_VERSION" >> $GITHUB_OUTPUT
echo "release_version_major=$APPLICATION_VERSION_MAJOR" >> $GITHUB_OUTPUT
- name: Update Java Version
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn versions:set -DnewVersion=${{ steps.configure-ubuntu.outputs.release_version }}
- name: Build Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx/build/ubuntu
cmake --build .
- name: Test Ubuntu
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
cd cxx/build/ubuntu
cp ../../dlibs/*.so.* .
ctest
- name: Setup Windows
id: setup-windows
if: matrix.os == 'windows-2019'
run: |
cd cxx
git clone https://github.com/google/googletest.git googletest
cd googletest
mkdir msvc
cd msvc
cmake ../ -Dgtest_force_shared_crt=ON
cmake --build . --config Release
echo "google_test_include_dir=googletest/googletest/include" >> $env:GITHUB_OUTPUT
echo "google_test_library_dir=googletest/msvc/lib/Release" >> $env:GITHUB_OUTPUT
- name: Download GDAL
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Invoke-WebRequest "https://heartlandsoftwaresolutions.sharepoint.com/:u:/g/HSS_Releases/EXnrOV_5audDuUmQjHymeDYBC_nMbcSQcOjP5Wi4IcPvkA?e=d8HeAq&download=1" -OutFile gdal.7z
& 7z.exe x gdal.7z -ogdal -y
- name: Configure CMake Windows
if: matrix.os == 'windows-2019'
run: |
cd cxx
mkdir build
cd build
mkdir windows
cd windows
cmake ../../ -DBOOST_INCLUDE_DIR=${{ steps.install-boost.outputs.root }} -DMSVC=1 -DGTEST_INCLUDE_DIR=${{ steps.setup-windows.outputs.google_test_include_dir }} -DGTEST_LIBRARY_DIR=${{ steps.setup-windows.outputs.google_test_library_dir }} -DLOWLEVEL_INCLUDE_DIR=HSS_LowLevel/include -DTHIRD_PARTY_INCLUDE_DIR=HSS_LowLevel/third_party -DMULTITHREAD_INCLUDE_DIR=HSS_Multithread/include -DERROR_CALC_INCLUDE_DIR=ErrorCalc/include -DMATH_INCLUDE_DIR=HSS_Math/include -DGEOGRAPHY_INCLUDE_DIR=HSS_Geography/include -DGDAL_INCLUDE_DIR=gdal/include -DPROTOBUF_INCLUDE_DIR=protobuf/src -DLOCAL_LIBRARY_DIR=dlibs -DPROTOBUF_LIBRARY_DIR=protobuf/cmake/build/Release -DGDAL_LIBRARY_DIR=gdal/lib -DBOOST_LIBRARY_DIR=${{ steps.install-boost.outputs.librarydir }}\..
- name: Build Windows
if: matrix.os == 'windows-2019'
run: |
cd cxx/build/windows
cmake --build . --config ${{env.BUILD_TYPE}}
- name: Archive Ubuntu Library
if: matrix.os == 'ubuntu-20.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Ubuntu-20.04.zip -Path build\ubuntu\libWTime.so,build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version_major }},build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version }}
mv lib-Ubuntu-20.04.zip ..
- name: Upload Ubuntu Library
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Ubuntu-20.04.zip
retention-days: 1
- name: Archive Ubuntu Library
if: matrix.os == 'ubuntu-22.04'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Ubuntu-22.04.zip -Path build\ubuntu\libWTime.so,build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version_major }},build\ubuntu\libWTime.so.${{ steps.configure-ubuntu.outputs.release_version }}
mv lib-Ubuntu-22.04.zip ..
- name: Upload Ubuntu Library
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Ubuntu-22.04.zip
retention-days: 1
- name: Archive Windows Library
if: matrix.os == 'windows-2019'
shell: pwsh
run: |
cd cxx
Compress-Archive -DestinationPath lib-Windows-2019.zip -Path build\windows\Release\WTime.dll,build\windows\Release\WTime.lib
mv lib-Windows-2019.zip ..
- name: Upload Windows Library
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: lib-Windows-2019.zip
retention-days: 1
- name: Setup the Maven configuration file
uses: whelk-io/maven-settings-xml-action@v21
with:
servers: '[{ "id": "github", "username": "tredpath", "password": "${{ secrets.HSS_PAT }}" }]'
- name: Build Java
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn --batch-mode clean compile package
- name: Upload Java Library
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v3
with:
name: release-libs
path: java/target/WTime.jar
retention-days: 1
- name: Publish package
if: matrix.os == 'ubuntu-22.04'
run: |
cd java
mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.HSS_PAT }}
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Previous Tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: 'c2.5.0.10'
- name: Tag the repository
run: |
git config user.name github-actions
git config user.email github-actions@github.com
RELEASE_TAG=c${{ needs.build.outputs.release_version }}
git tag -a $RELEASE_TAG -m "C++ release on $(date +'%Y-%m-%d') for commit $(git rev-parse HEAD)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Download Libraries
uses: actions/download-artifact@v3
with:
name: release-libs
- name: Create Release Notes
id: build-notes
uses: mikepenz/release-changelog-builder-action@v3.5.0
with:
toTag: c${{ needs.build.outputs.release_version }}
fromTag: ${{ steps.previoustag.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.build.outputs.release_version }}
body: ${{ steps.build-notes.outputs.changelog }}
files: |
lib-Windows-2019.zip
lib-Ubuntu-20.04.zip
lib-Ubuntu-22.04.zip
includes.zip
proto_def.zip
WTime.jar
tag_name: refs/tags/c${{ needs.build.outputs.release_version }}