-
-
Notifications
You must be signed in to change notification settings - Fork 115
691 lines (595 loc) · 26.5 KB
/
deploy.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
name: deploy
on:
push:
branches: [ "master", "current", "release/*" ]
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches: [ "master", "current", "release/*" ]
workflow_dispatch:
env:
APP_NAME: "Qucs-S"
EXECUTABLE_NAME: "qucs-s"
PUBLISHER_NAME: "The Qucs-S Team"
BUILD_TYPE: Release
QT_VERSION: 6.8.1
QUCS_MACOS_BIN: ${{github.workspace}}/build/qucs/qucs-s.app/Contents/MacOS/bin
QUCS_MACOS_RESOURCES: ${{github.workspace}}/build/qucs/qucs-s.app/Contents/MacOS/share/qucs-s
NGSPICE_URL: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/43/ngspice-43_64.7z
jobs:
setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.read_version.outputs.version }}
short_hash: ${{ steps.read_version.outputs.short_hash }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read version from file
id: read_version
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
VERSION=${{ github.ref_name }}
SHORT_HASH=""
else
MAJOR_MINOR=$(cut -d. -f1-2 VERSION)
VERSION="${MAJOR_MINOR}.99"
# Get the short hash of the current commit
COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
SHORT_HASH="-$COMMIT_HASH"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "SHORT_HASH=$SHORT_HASH" >> $GITHUB_ENV
echo "short_hash=$SHORT_HASH" >> $GITHUB_OUTPUT
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
build-linux-qt5:
runs-on: ubuntu-22.04
continue-on-error: true
needs: setup
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglx-dev libgl1-mesa-dev flex bison gperf dos2unix flex bison gperf dos2unix cups libcups2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: 'Install Qt5'
uses: jurplel/install-qt-action@v4
with:
version: 5.15.2
host: 'linux'
target: 'desktop'
cache: true
arch: 'gcc_64'
install-deps: 'true'
modules: 'qtcharts'
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build'
# Build your program with the given configuration
run: |
cmake --build ${{github.workspace}}/build -j`nproc` --config ${{env.BUILD_TYPE}}
build-linux-appimage-qt6:
runs-on: ubuntu-22.04
needs: setup
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglx-dev libgl1-mesa-dev flex bison gperf dos2unix flex bison gperf dos2unix cups libcups2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: 'Install Qt6'
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: 'linux'
target: 'desktop'
cache: true
arch: 'linux_gcc_64'
install-deps: 'true'
modules: 'qtcharts'
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}/build -G 'Ninja' \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/AppDir/usr \
-DWITH_QT6=ON \
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build'
# Build your program with the given configuration
run: |
cmake --build ${{github.workspace}}/build -j`nproc` --config ${{env.BUILD_TYPE}}
cmake --build ${{github.workspace}}/build --target install
- name: 'Install linuxdeploy'
run: |
wget -q --tries=3 --wait=5 \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q --tries=3 --wait=5 \
https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
sudo apt-get install fuse libfuse2
chmod +x linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
- name: 'Create AppImage'
run: |
./linuxdeploy-x86_64.AppImage --appdir ${{github.workspace}}/AppDir \
--desktop-file=${{github.workspace}}/AppDir/usr/share/applications/qucs-s.desktop \
--icon-file=${{github.workspace}}/AppDir/usr/share/icons/hicolor/256x256/apps/qucs-s.png \
--plugin=qt --output appimage
rm linuxdeploy-x86_64.AppImage
rm linuxdeploy-plugin-qt-x86_64.AppImage
mv *.AppImage ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64.AppImage
- name: 'Upload artifact: AppImage'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64
path: ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64.AppImage
build-mac-intel:
runs-on: macos-13
needs: setup
strategy:
fail-fast: false
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Install Qt6'
uses: jurplel/install-qt-action@v4
with:
version: '6.2.4'
host: 'mac'
target: 'desktop'
cache: true
arch: 'clang_64'
install-deps: 'true'
modules: 'qtcharts'
- name: 'Install Dependencies'
shell: bash
run: |
brew install gperf dos2unix bison flex ninja graphicsmagick imagemagick
echo 'export PATH="$(brew --prefix bison)/bin:$PATH"' >> /Users/runner/.bashrc
export LDFLAGS="-L$(brew --prefix bison)/lib"
source ~/.bashrc
brew link bison --force
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}/build -G 'Ninja' \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_QT6=1 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build Qucs-s'
run: |
cmake --build ${{github.workspace}}/build --parallel --config=${{env.BUILD_TYPE}}
- name: 'Package App Bundle'
run: |
mkdir -p ${{env.QUCS_MACOS_BIN}}
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/examples
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/library
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/symbols
cp -pR ${{github.workspace}}/build/qucs-activefilter/qucs-sactivefilter.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-attenuator/qucs-sattenuator.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-filter/qucs-sfilter.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-powercombining/qucs-spowercombining.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-s-spar-viewer/qucs-sspar-viewer.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-transcalc/qucs-strans.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucsator_rf/src/qucsator_rf ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucsator_rf/src/converter/qucsconv_rf ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/examples/* ${{env.QUCS_MACOS_RESOURCES}}/examples
cp -pR ${{github.workspace}}/library/*.lib ${{env.QUCS_MACOS_RESOURCES}}/library
cp -pR ${{github.workspace}}/library/*.blacklist ${{env.QUCS_MACOS_RESOURCES}}/library
cp -pR ${{github.workspace}}/library/symbols/* ${{env.QUCS_MACOS_RESOURCES}}/symbols
macdeployqt ${{github.workspace}}/build/qucs/qucs-s.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sactivefilter.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sattenuator.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sfilter.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-spowercombining.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sspar-viewer.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-strans.app
strip ${{env.QUCS_MACOS_BIN}}/qucsator_rf
strip ${{env.QUCS_MACOS_BIN}}/qucsconv_rf
codesign --force --deep --sign - ${{github.workspace}}/build/qucs/qucs-s.app
npm install --global create-dmg
create-dmg ${{github.workspace}}/build/qucs/qucs-s.app ${{github.workspace}}/build/qucs/ || true
cp -pR ${{github.workspace}}/build/qucs/qucs-*.dmg ${{github.workspace}}/${{ env.APP_NAME }}-${{env.VERSION}}-macOSX-x86_64.dmg
- name: 'Upload build artifacts'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{env.VERSION}}-macOSX-x86_64
path: ${{ env.APP_NAME }}-${{env.VERSION}}-macOSX-x86_64.dmg
build-mac-universal:
runs-on: macos-15
needs: setup
strategy:
fail-fast: false
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Install Qt6'
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: 'mac'
target: 'desktop'
cache: true
arch: 'clang_64'
install-deps: 'true'
modules: 'qtcharts'
- name: 'Install Dependencies'
shell: bash
run: |
brew install gperf dos2unix bison flex ninja graphicsmagick imagemagick
echo 'export PATH="$(brew --prefix bison)/bin:$PATH"' >> /Users/runner/.bashrc
export LDFLAGS="-L$(brew --prefix bison)/lib"
source ~/.bashrc
brew link bison --force
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}/build -G 'Ninja' \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_QT6=1 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build Qucs-s'
run: |
cmake --build ${{github.workspace}}/build --parallel --config=${{env.BUILD_TYPE}}
- name: 'Package App Bundle'
run: |
mkdir -p ${{env.QUCS_MACOS_BIN}}
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/examples
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/library
mkdir -p ${{env.QUCS_MACOS_RESOURCES}}/symbols
cp -pR ${{github.workspace}}/build/qucs-activefilter/qucs-sactivefilter.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-attenuator/qucs-sattenuator.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-filter/qucs-sfilter.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-powercombining/qucs-spowercombining.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-s-spar-viewer/qucs-sspar-viewer.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucs-transcalc/qucs-strans.app ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucsator_rf/src/qucsator_rf ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/build/qucsator_rf/src/converter/qucsconv_rf ${{env.QUCS_MACOS_BIN}}
cp -pR ${{github.workspace}}/examples/* ${{env.QUCS_MACOS_RESOURCES}}/examples
cp -pR ${{github.workspace}}/library/*.lib ${{env.QUCS_MACOS_RESOURCES}}/library
cp -pR ${{github.workspace}}/library/*.blacklist ${{env.QUCS_MACOS_RESOURCES}}/library
cp -pR ${{github.workspace}}/library/symbols/* ${{env.QUCS_MACOS_RESOURCES}}/symbols
macdeployqt ${{github.workspace}}/build/qucs/qucs-s.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sactivefilter.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sattenuator.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sfilter.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-spowercombining.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-sspar-viewer.app
macdeployqt ${{env.QUCS_MACOS_BIN}}/qucs-strans.app
strip ${{env.QUCS_MACOS_BIN}}/qucsator_rf
strip ${{env.QUCS_MACOS_BIN}}/qucsconv_rf
codesign --force --deep --sign - ${{github.workspace}}/build/qucs/qucs-s.app
npm install --global create-dmg
create-dmg ${{github.workspace}}/build/qucs/qucs-s.app ${{github.workspace}}/build/qucs/ || true
cp -pR ${{github.workspace}}/build/qucs/qucs-*.dmg ${{github.workspace}}/${{ env.APP_NAME }}-${{env.VERSION}}-macOS.dmg
- name: 'Upload build artifacts'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{env.VERSION}}-macOS
path: ${{ env.APP_NAME }}-${{env.VERSION}}-macOS.dmg
build-windows-msvc:
runs-on: windows-latest
needs: setup
strategy:
fail-fast: false
defaults:
run:
shell: pwsh
steps:
- name: Disable autocrlf in Git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Checkout repository
uses: actions/checkout@v4
- name: 'Install Qt6'
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: 'windows'
target: 'desktop'
cache: true
arch: 'win64_msvc2022_64'
install-deps: 'true'
modules: 'qtcharts'
- name: '⚙️ Install CMake'
uses: lukka/get-cmake@latest
- name: '🛠 Setup MSVC Development Environment'
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: 'Configure CMake'
run: |
cmake -B ${{github.workspace}}\build -G 'Ninja' -DWITH_QT6=1 `
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}\build\qucs-suite `
-DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCI_VERSION="${{env.VERSION}}"
- name: 'Build Qucs-s'
run: |
cmake --build ${{github.workspace}}\build --parallel --config=${{env.BUILD_TYPE}}
- name: 'Cmake install'
run: |
cmake --build ${{github.workspace}}\build --target install
- name: 'Deploy Qt6 dependencies'
run: |
$qucs_bin_dir = "${{github.workspace}}\build\qucs-suite\bin"
$executables = @(
"qucs-s.exe", "qucs-sactivefilter.exe", "qucs-sattenuator.exe",
"qucs-sfilter.exe", "qucs-spowercombining.exe", "qucs-strans.exe",
"qucs-sspar-viewer.exe"
)
$executables | ForEach-Object { windeployqt "$qucs_bin_dir\$_" --no-translations --no-opengl-sw --no-system-d3d-compiler --no-network --no-compiler-runtime }
- name: 'Add ngspice to release'
run: |
$qucs_dir = "${{github.workspace}}\build\qucs-suite"
curl -sL --retry 3 --retry-delay 5 -o ngspice.7z ${{ env.NGSPICE_URL }}
7z.exe x ngspice.7z -ongspice
New-Item -ItemType Directory -Path "$qucs_dir\lib\ngspice" -Force
Copy-Item -Recurse -Force ngspice\Spice64\bin\ $qucs_dir
Copy-Item -Recurse -Force ngspice\Spice64\lib\ $qucs_dir
- name: 'Create zip archive for release'
run: |
$qucs_dir = "${{github.workspace}}\build\qucs-suite"
New-Item -ItemType Directory -Path "$qucs_dir\misc" -Force
Copy-Item -Recurse -Force "contrib\InnoSetup\misc" "$qucs_dir"
cd $qucs_dir
$zipName = "${env:APP_NAME}-${env:VERSION}${env:SHORT_HASH}-MSVC-x64.zip"
Compress-Archive -Path ./bin, ./share, ./lib, ./misc -DestinationPath "${{github.workspace}}\$zipName"
cd ${{github.workspace}}
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
with:
path: contrib/InnoSetup/qucs.iss
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}${{ env.SHORT_HASH }}-MSVC"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-MSVC-x64
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-MSVC-x64.zip
- name: Upload exe artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-MSVC-setup
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-MSVC-setup.exe
build-windows:
runs-on: windows-2022
continue-on-error: true
needs: setup
strategy:
fail-fast: false
defaults:
run:
shell: msys2 {0}
steps:
- name: Disable autocrlf in Git
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Set version environment variable
shell: pwsh
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Print version and hash
shell: pwsh
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up MSYS2 environment
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
cache: true
update: true
install: bison flex dos2unix curl zip p7zip
pacboy: cmake:p gcc:p qt6-base:p qt6-tools:p qt6-svg:p make:p ninja:p python:p gperf:p github-cli:p qt6-charts:p
- name: Build project with CMake
run: |
cmake.exe -B build/ -G 'Ninja' \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX=build/qucs-suite \
-DWITH_QT6=ON \
-DCI_VERSION="${{env.VERSION}}"
cmake.exe --build build/ --parallel --config ${{env.BUILD_TYPE}}
- name: Make install
run: |
cmake --build build/ --target install
strip build/qucs-suite/bin/*.exe
- name: Deploy Qt6 dependencies
run: |
deploy_tool="windeployqt-qt6.exe"
bin_dir="build/qucs-suite/bin"
options="--svg --no-translations --no-system-d3d-compiler --no-network"
executables=(
"qucs-s.exe" "qucs-sactivefilter.exe" "qucs-sattenuator.exe"
"qucs-sfilter.exe" "qucs-spowercombining.exe" "qucs-strans.exe"
"qucs-sspar-viewer.exe"
)
for exe in "${executables[@]}"; do
$deploy_tool "$bin_dir/$exe" $options
done
- name: Copy non-Qt DLLs to bin directory
run: |
shopt -s extglob
FILES=$(ldd build/qucs-suite/bin/qucs-s.exe | awk '($3 ~ /\/ucrt64\/bin\//) {print $3}')
for file in $FILES; do
if [[ $(basename "$file") != Qt6* ]]; then
cp -r "$file" build/qucs-suite/bin
fi
done
- name: Add ngspice to release
run: |
curl -sL --retry 3 --retry-delay 5 -o ngspice.7z ${{ env.NGSPICE_URL }}
7z x ngspice.7z -ongspice
mkdir -p build/qucs-suite/lib/ngspice
cp -rf ngspice/Spice64/bin/ build/qucs-suite
cp -rf ngspice/Spice64/lib/ build/qucs-suite
- name: Create zip archive for release
run: |
mkdir -p build/qucs-suite/misc
cp -rf contrib/InnoSetup/misc build/qucs-suite/
cd build/qucs-suite
zip -r ../../${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64.zip ./bin ./share ./lib ./misc
cd ../..
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected]
with:
path: contrib/InnoSetup/qucs.iss
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}${{ env.SHORT_HASH }}"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64.zip
- name: Upload exe artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-setup
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-setup.exe
create-release:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: [setup, build-linux-appimage-qt6, build-mac-intel, build-mac-universal, build-windows]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: ~/artifacts
merge-multiple: true
- name: Calculate SHA-256 checksums
run: |
cd ~/artifacts
> hashes.sha256
for file in $(find . -type f \( -name "*-setup.exe" ! -name "*-MSVC-setup.exe" -o -name "*-win64.zip" -o -name "*.dmg" -o -name "*.AppImage" \)); do
filename=$(basename "$file")
sha256sum "$file" | awk -v fname="$filename" '{print $1 " *" fname}' >> hashes.sha256
done
cd ..
tree ~/artifacts
- name: Setup Release Information
run: |
if [ "${{github.ref_type}}" == "tag" ]; then
echo "PRERELEASE=" >> $GITHUB_ENV
echo "RELEASE_NAME=Qucs-S ${{ github.ref_name }}" >> $GITHUB_ENV
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
echo "RELEASE_NOTES=--generate-notes" >> $GITHUB_ENV
else
echo "PRERELEASE=-p" >> $GITHUB_ENV
echo "RELEASE_NAME=Continuous Build" >> $GITHUB_ENV
echo "TAG_NAME=continuous_build" >> $GITHUB_ENV
echo "RELEASE_NOTES=--notes \"Automated release for commit ${{ github.sha }}\"" >> $GITHUB_ENV
fi
- name: Create GitHub Release
continue-on-error: false
run: |
# Find existing artifact files
hash_files=$(find ~/artifacts -name "*.sha256" -print0 | xargs -0 echo)
exe_files=$(find ~/artifacts -name "*-setup.exe" ! -name "*-MSVC-setup.exe" -print0 | xargs -0 echo)
zip_files=$(find ~/artifacts -name "*-win64.zip" -print0 | xargs -0 echo)
dmg_files=$(find ~/artifacts -name "*.dmg" -print0 | xargs -0 echo)
appimage_files=$(find ~/artifacts -name "*.AppImage" -print0 | xargs -0 echo)
# Check existing release and delete if it's exist
if gh release view ${{ env.TAG_NAME }} --repo $GITHUB_REPOSITORY &> /dev/null; then
if [ "${{ env.TAG_NAME }}" == "continuous_build" ]; then
gh release delete ${{ env.TAG_NAME }} --repo $GITHUB_REPOSITORY --cleanup-tag --yes
else
gh release delete ${{ env.TAG_NAME }} --repo $GITHUB_REPOSITORY
fi
echo "${{ env.TAG_NAME }} deleted!"
fi
if [ -n "$exe_files" ] && [ -n "$zip_files" ] && [ -n "$dmg_files" ] && [ -n "$appimage_files" ]; then
gh release create ${{ env.TAG_NAME }} \
$exe_files \
$zip_files \
$dmg_files \
$appimage_files \
$hash_files \
${{ env.PRERELEASE }} \
--repo $GITHUB_REPOSITORY \
--title "${{ env.RELEASE_NAME }}" \
${{ env.RELEASE_NOTES }}
echo "${{ env.TAG_NAME }} release created!"
else
echo "No artifacts to upload."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}