1
- name : Github CI
1
+ name : Multi-Platform CI
2
2
on :
3
3
push :
4
4
branches :
8
8
tags :
9
9
- ' 0.*.*'
10
10
- ' 0.*'
11
+ - ' nightly-*'
11
12
pull_request :
12
13
branches :
13
14
- ' *'
15
+ workflow_dispatch :
16
+ inputs :
17
+ build_artifacts :
18
+ description : ' Build and upload artifacts'
19
+ required : false
20
+ default : true
21
+ type : boolean
14
22
15
23
concurrency :
16
24
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -21,12 +29,14 @@ concurrency:
21
29
# os: [ubuntu-14.04, ubuntu-18.04, ubuntu-20.04, ubuntu-latest]
22
30
23
31
jobs :
24
- linux :
25
- runs-on : ubuntu-latest
32
+ # Ubuntu builds for multiple versions
33
+ ubuntu :
34
+ runs-on : ${{ matrix.os }}
26
35
timeout-minutes : 50
27
36
strategy :
28
- fail-fast : true
37
+ fail-fast : false
29
38
matrix :
39
+ os : [ubuntu-22.04, ubuntu-latest]
30
40
CONFIGURE_ARGS :
31
41
- CFLAGS="-O1 -fno-omit-frame-pointer -fsanitize=address -fno-var-tracking" --disable-bindings --disable-docs
32
42
- CC="clang"
77
87
- uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
78
88
with :
79
89
create-symlink : true
80
- key : ${{ github.job }}-${{ matrix.CONFIGURE_ARGS }}
90
+ key : ${{ github.job }}-${{ matrix.os }}-${{ matrix. CONFIGURE_ARGS }}
81
91
- run : sh autogen.sh
82
92
- if : contains(matrix.CONFIGURE_ARGS, '-fsanitize=address')
83
93
name : Fix kernel mmap rnd bits for -fsanitize=address
@@ -96,6 +106,18 @@ jobs:
96
106
!contains(matrix.CONFIGURE_ARGS, '--enable-debug') &&
97
107
startsWith(github.ref, 'refs/heads/') }}
98
108
run : make -j check
109
+ # Create Ubuntu artifacts for release config
110
+ - if : contains(matrix.CONFIGURE_ARGS, '--enable-release') && matrix.os == 'ubuntu-latest'
111
+ name : Create Linux artifact
112
+ run : |
113
+ make install DESTDIR=$PWD/install_dir
114
+ tar czf libredwg-linux-x86_64.tar.gz -C install_dir .
115
+ - if : contains(matrix.CONFIGURE_ARGS, '--enable-release') && matrix.os == 'ubuntu-latest'
116
+ name : Upload Linux artifact
117
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
118
+ with :
119
+ name : libredwg-linux-x86_64
120
+ path : libredwg-linux-x86_64.tar.gz
99
121
# run: |
100
122
# python -m pip install cpp-coveralls
101
123
# make gcov
@@ -191,9 +213,130 @@ jobs:
191
213
with :
192
214
name : cmake-failure.tgz
193
215
path : cmake-failure.tgz
216
+ # Fedora build using container
217
+ fedora :
218
+ runs-on : ubuntu-latest
219
+ container : fedora:latest
220
+ timeout-minutes : 30
221
+ steps :
222
+ - name : Install dependencies
223
+ run : |
224
+ dnf install -y git gcc gcc-c++ make autoconf automake libtool \
225
+ texinfo libxml2-devel pcre2-devel python3-devel swig \
226
+ redhat-rpm-config ccache which perl glibc-langpack-en
227
+ - name : checkout
228
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
229
+ with :
230
+ fetch-depth : 1
231
+ submodules : recursive
232
+ - name : Configure git safe directory
233
+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
234
+ - uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
235
+ with :
236
+ create-symlink : true
237
+ key : ${{ github.job }}
238
+ - run : sh autogen.sh
239
+ - name : Configure with FORTIFY_SOURCE disabled
240
+ run : CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" ./configure --disable-werror
241
+ - run : make -j
242
+ - run : |
243
+ # Run tests with more verbose output and continue on error
244
+ make -j check VERBOSE=1 || {
245
+ echo "Tests failed, checking test logs..."
246
+ find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec tail -20 {} \;
247
+ exit 1
248
+ }
249
+
250
+ # Debian build using container
251
+ debian :
252
+ runs-on : ubuntu-latest
253
+ container : debian:latest
254
+ timeout-minutes : 30
255
+ steps :
256
+ - name : Install dependencies
257
+ run : |
258
+ apt-get update
259
+ apt-get install -y git gcc g++ make autoconf automake libtool \
260
+ texinfo libxml2-dev libpcre2-dev python3-dev swig ccache
261
+ - name : checkout
262
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
263
+ with :
264
+ fetch-depth : 1
265
+ submodules : recursive
266
+ - name : Configure git safe directory
267
+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
268
+ - uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
269
+ with :
270
+ create-symlink : true
271
+ key : ${{ github.job }}
272
+ - run : sh autogen.sh
273
+ - run : ./configure --disable-werror
274
+ - run : make -j
275
+ - run : make -j check
276
+
277
+ # CentOS/RHEL build using container
278
+ centos :
279
+ runs-on : ubuntu-latest
280
+ container : rockylinux:9
281
+ timeout-minutes : 30
282
+ steps :
283
+ - name : Install dependencies
284
+ run : |
285
+ dnf install -y epel-release
286
+ dnf config-manager --set-enabled crb
287
+ dnf install -y git gcc gcc-c++ make autoconf automake libtool \
288
+ texinfo libxml2-devel pcre2-devel python3-devel \
289
+ ccache which perl
290
+ - name : checkout
291
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
292
+ with :
293
+ fetch-depth : 1
294
+ submodules : recursive
295
+ - name : Configure git safe directory
296
+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
297
+ - uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
298
+ with :
299
+ create-symlink : true
300
+ key : ${{ github.job }}
301
+ - run : sh autogen.sh
302
+ - run : ./configure --disable-werror
303
+ - run : make -j
304
+ - run : make -j check
305
+
306
+ # Alpine Linux build (musl libc)
307
+ alpine :
308
+ runs-on : ubuntu-latest
309
+ container : alpine:latest
310
+ timeout-minutes : 30
311
+ steps :
312
+ - name : Install dependencies
313
+ run : |
314
+ apk add --no-cache git gcc g++ make autoconf automake libtool \
315
+ texinfo libxml2-dev pcre2-dev python3-dev swig ccache bash perl
316
+ - name : checkout
317
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
318
+ with :
319
+ fetch-depth : 1
320
+ submodules : recursive
321
+ - name : Configure git safe directory
322
+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
323
+ - uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
324
+ with :
325
+ create-symlink : true
326
+ key : ${{ github.job }}
327
+ - run : sh autogen.sh
328
+ - run : ./configure --disable-werror --disable-python
329
+ - run : make -j
330
+ - run : make -j check
331
+
194
332
macOS :
195
333
name : macOS
196
- runs-on : macOS-latest
334
+ runs-on : ${{ matrix.os }}
335
+ strategy :
336
+ fail-fast : false
337
+ matrix :
338
+ os : [macos-13, macos-latest]
339
+ compiler : [gcc, clang]
197
340
steps :
198
341
- name : init
199
342
run : brew install autoconf automake libtool texinfo
@@ -211,12 +354,24 @@ jobs:
211
354
- uses : hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
212
355
with :
213
356
create-symlink : true
214
- key : ${{ github.job }}
357
+ key : ${{ github.job }}-${{ matrix.os }}-${{ matrix.compiler }}
215
358
- run : sh autogen.sh
216
- - run : ./configure --disable-bindings --disable-werror
359
+ - run : CC="${{ matrix.compiler }}" ./configure --disable-bindings --disable-werror
217
360
- run : PATH="/usr/local/opt/texinfo/bin:$PATH" make
218
361
- run : PATH="/usr/local/opt/texinfo/bin:$PATH" make check
219
362
# - run: make distcheck
363
+ # Create macOS artifacts
364
+ - if : matrix.compiler == 'clang' && matrix.os == 'macos-latest'
365
+ name : Create macOS artifact
366
+ run : |
367
+ make install DESTDIR=$PWD/install_dir
368
+ tar czf libredwg-macos-${{ matrix.os }}.tar.gz -C install_dir .
369
+ - if : matrix.compiler == 'clang' && matrix.os == 'macos-latest'
370
+ name : Upload macOS artifact
371
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
372
+ with :
373
+ name : libredwg-macos-${{ matrix.os }}
374
+ path : libredwg-macos-${{ matrix.os }}.tar.gz
220
375
mingw :
221
376
name : mingw
222
377
runs-on : windows-latest
@@ -273,6 +428,19 @@ jobs:
273
428
path : mingw-failure.tgz
274
429
- shell : msys2 {0}
275
430
run : make -j check
431
+ # Create Windows MinGW artifacts
432
+ - if : success()
433
+ shell : msys2 {0}
434
+ name : Create Windows MinGW artifact
435
+ run : |
436
+ make install DESTDIR=$PWD/install_dir
437
+ tar czf libredwg-win64-mingw.tar.gz -C install_dir .
438
+ - if : success()
439
+ name : Upload Windows MinGW artifact
440
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
441
+ with :
442
+ name : libredwg-win64-mingw
443
+ path : libredwg-win64-mingw.tar.gz
276
444
mingw-cmake :
277
445
runs-on : windows-latest
278
446
timeout-minutes : 20
@@ -311,6 +479,21 @@ jobs:
311
479
- run : cmake --build . --config Release
312
480
- run : copy Release/libredwg.dll test/unit-testing/Release/
313
481
- run : ctest . --output-on-failure
482
+ # Create Windows MSVC artifacts
483
+ - if : success()
484
+ name : Create Windows MSVC artifact
485
+ run : |
486
+ mkdir msvc-build
487
+ copy Release\*.dll msvc-build\
488
+ copy Release\*.exe msvc-build\
489
+ copy Release\*.lib msvc-build\
490
+ tar czf libredwg-win64-msvc.tar.gz msvc-build
491
+ - if : success()
492
+ name : Upload Windows MSVC artifact
493
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
494
+ with :
495
+ name : libredwg-win64-msvc
496
+ path : libredwg-win64-msvc.tar.gz
314
497
- if : failure()
315
498
run : tar cfz msvc-failure.tgz Testing/Temporary/LastTest.log src/config.h
316
499
- if : failure()
@@ -352,3 +535,73 @@ jobs:
352
535
- run : ninja
353
536
- run : copy libredwg.dll test\unit-testing\
354
537
- run : ctest . --output-on-failure
538
+
539
+ # Aggregate all platform artifacts for releases
540
+ release-artifacts :
541
+ name : Release Artifacts
542
+ # Run on tags or successful master builds
543
+ if : |
544
+ always() &&
545
+ (startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/master' && github.event_name == 'push')) &&
546
+ !cancelled()
547
+ needs : [ubuntu, fedora, debian, alpine, centos, macOS, mingw, vs2019]
548
+ runs-on : ubuntu-latest
549
+ steps :
550
+ - name : Checkout for version info
551
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
552
+ with :
553
+ fetch-depth : 0 # Need full history for git-version-gen
554
+
555
+ - name : Get version and build number
556
+ id : version
557
+ run : |
558
+ VERSION=$(./build-aux/git-version-gen .tarball-version)
559
+ BUILD_NUM=$(git rev-list --count HEAD)
560
+ SHORT_SHA=$(git rev-parse --short HEAD)
561
+ if [[ "${{ github.ref }}" == refs/tags/* ]]; then
562
+ TAG_NAME="${GITHUB_REF#refs/tags/}"
563
+ RELEASE_NAME="Release $TAG_NAME"
564
+ PRERELEASE=false
565
+ else
566
+ TAG_NAME="$VERSION.$BUILD_NUM"
567
+ RELEASE_NAME="Nightly Build $VERSION.$BUILD_NUM ($SHORT_SHA)"
568
+ PRERELEASE=true
569
+ fi
570
+ echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
571
+ echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT
572
+ echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT
573
+ echo "Creating release: $RELEASE_NAME (tag: $TAG_NAME)"
574
+
575
+ - name : Download all artifacts
576
+ uses : actions/download-artifact@v4
577
+ with :
578
+ path : artifacts
579
+
580
+ - name : Create release checksums
581
+ run : |
582
+ cd artifacts
583
+ sha256sum */*.tar.gz > checksums.sha256
584
+ cat checksums.sha256
585
+
586
+ - name : Create Release
587
+ uses : softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
588
+ with :
589
+ tag_name : ${{ steps.version.outputs.tag_name }}
590
+ name : ${{ steps.version.outputs.release_name }}
591
+ prerelease : ${{ steps.version.outputs.prerelease }}
592
+ body : |
593
+ LibreDWG ${{ steps.version.outputs.release_name }}
594
+
595
+ Multi-platform builds for Linux, macOS, and Windows.
596
+
597
+ ## Downloads
598
+ - Linux builds: libredwg-linux-*.tar.gz
599
+ - macOS builds: libredwg-macos-*.tar.gz
600
+ - Windows MinGW: libredwg-win64-mingw.tar.gz
601
+ - Windows MSVC: libredwg-win64-msvc.tar.gz
602
+
603
+ See checksums.sha256 for file integrity verification.
604
+ files : |
605
+ artifacts/*/*.tar.gz
606
+ artifacts/checksums.sha256
607
+ fail_on_unmatched_files : false
0 commit comments