-
Notifications
You must be signed in to change notification settings - Fork 17
2325 lines (2048 loc) · 85.3 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
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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Full Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
# Expected filename: https://zlib.net/zlib-${{env.ZLIB_VERSION}}.tar.gz
ZLIB: https://zlib.net/
#ZLIB: https://ftp.zx.net.nz/pub/dev/lib/zlib/
# As of 2023-01-21 downloads from zlib.net were coming back corrupted for an unknown reason,
# so we switched fetching zlib from ftp.zx.net.nz instead. As of 2024-08-16 it seems to be
# fine, so we've switched back to zlib.net.
ZLIB_VERSION: 1.3.1
# Expected filename: https://github.com/openssl/openssl/releases/download/openssl-${{env.CK_OPENSSL_VERSION}}/openssl-${{env.CK_OPENSSL_VERSION}}.tar.gz
OPENSSL_VERSION: 3.4.0
# OpenSSL 3.0 and 3.1 aren't properly compatible with Windows on ARM, so we've
# got to use 3.2 or newer for that.
OPENSSL_ARM_VERSION: 3.4.0
# Exoected filename: ${{env.LIBSSH_SOURCE}}libssh-${{env.LIBSSH_VERSION}}.tar.xz
LIBSSH_SOURCE: https://www.libssh.org/files/0.10/
LIBSSH_VERSION: 0.10.6
# OpenZinc is available from http://openzinc.com/Downloads/OZ1.zip
# But we don't want to waste the resources of the generous OpenZinc developer,
# so we grab it from a mirror
OPENZINC: https://ftp.zx.net.nz/pub/dev/openzinc/oz1/OZ1.zip
# For building k95crypt.dll - expected to be a .tar.gz file
LIBDES: https://www.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/cryptography/libraries/libdes/libdes.tar.gz
# Kerberos for Windows - current release for modern builds
KFW_x86: https://web.mit.edu/kerberos/dist/kfw/4.1/kfw-4.1-i386.msi
KFW_x86_64: https://web.mit.edu/kerberos/dist/kfw/4.1/kfw-4.1-amd64.msi
# Infozip
#INFOZIP_FTP: https://ftp.zx.net.nz/pub/archive/ftp.info-zip.org/pub/infozip/
INFOZIP_FTP: ftp://ftp.info-zip.org/pub/infozip/
# These are the binaries we expect to be generated by any standard build of K95
# This includes the core applications plus the telnet crypto and XYZ-MODEM DLLs.
# ctl3dins.exe is not currently included but perhaps should be.
STANDARD_BUILD_OUTPUTS: k95.exe iksd.exe iksdsvc.exe k95d.exe rlogin.exe telnet.exe textps.exe k95g.exe k95crypt.dll p95.dll
# And these are what we currently expect from standard builds for OS/2
OS2_BUILD_OUTPUTS: k2.exe k2clip.exe k2dc.exe rlogin.exe telnet.exe telnetpm.exe textps.exe p2.dll nullssh.dll
# Use JOM instead of nmake for parallel builds
JOM: https://download.qt.io/official_releases/jom/jom.zip
# Make tool for openssl builds. Jom works fine with OpenSSL 1.1.1 but is broken with 3.0.10.
# If jom works ideally we use that as it results in shorter build times.
OPENSSL_MAKE: nmake
# Any extra build flags for OpenSSL. -FS is required if using Jom.
# and -D"_WIN32_WINNT=0x502" is required for targeting Windows XP
OPENSSL_EXTRA_BUILD_FLAGS: -D"_WIN32_WINNT=0x502" -FS
# Where to get the latest official C-Kermit for UNIX/Linux/MacOS X from
# along with its version. The version is only used as a cache key to ensure
# we're not hammering the kermit website or fetching code thats newer than
# what K95 is currently based on.
C_KERMIT_VERSION: 10.0beta11
#C_KERMIT_CODE: https://www.kermitproject.org/ftp/kermit/test/tar/x.tar.gz
C_KERMIT_CODE: https://kermitproject.org/ftp/kermit/pretest/x.tar.gz
# Grab it from ftp.zx.net.nz as its normally distributed via sourceforge
# with its annoying interstitial advertising page
REGINA_VER: 3.9.6
REGINA_REXX: https://ftp.zx.net.nz/pub/dev/rexx/regina/3.9.6/regina396.zip
# RexxRE: Regular expressions for rexx!
REXXRE: http://home.interlog.com/~ptjm/rexxre101.zip
# Should the original ever go down (its not been updated in over 20 years),
# a mirror is here:
#REXXRE: https://ftp.zx.net.nz/pub/dev/rexx/ptjm/rexxre101.zip
#
# OS/2 Developer's Toolkit v4.5 is available on David Azarewicz's 88watts.net
# *supposedly* with permission from IBM - or so Arca Noae (which David is
# involved with) claims on this page:
# https://www.arcanoae.com/wiki/information-for-developers/
# It is needed only for building the IBM TCP/IP 2.0 TCP/IP backend. The SDK
# for this is also available on the OS/2 Warp 4 CD.
OS2TK45: https://88watts.net/dlfile.php?F=Os2Tk45-
jobs:
Get-CACerts-Bundle:
runs-on: windows-latest
steps:
- name: Fetch CA Certs bundle
run: |
wget https://curl.se/ca/cacert.pem -outfile ca_certs.pem
wget https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt -outfile ca_certs.license
$readme = @"
ca_certs.pem was exported from the Mozilla CA Certificate Store and is licensed
under the MPL version 2.0.
For more information and updates, see: https://curl.se/docs/caextract.html
"@
New-Item ca_certs.readme
Set-Content ca_certs.readme $readme
dir
shell: powershell
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ca_certs
path: |
*.pem
*.readme
*.license
retention-days: 1
Prepare-Docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: HTMLise Markdown Docs
run: |
pip3 install markdown
(
echo ^<html^>
echo ^<head^>^<title^>Kermit 95 SSH Readme^</title^>^</head^>
echo ^<body^>
) > ssh-readme.html
(
echo ^<html^>
echo ^<head^>^<title^>Kermit 95 Change-Log^</title^>^</head^>
echo ^<body^>
) > change-log.html
python -m markdown -x markdown.extensions.fenced_code ${{ github.workspace }}\doc\ssh-readme.md >> ssh-readme.html
python -m markdown -x markdown.extensions.fenced_code ${{ github.workspace }}\doc\changes.md >> change-log.html
(
echo ^</body^>
echo ^</html^>
) >> change-log.html
(
echo ^</body^>
echo ^</html^>
) >> ssh-readme.html
shell: cmd
working-directory: ${{ github.workspace }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: markdown-docs
path: |
change-log.html
ssh-readme.html
retention-days: 1
Build-Wart:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Enable Developer Command Prompt
# You may pin to the exact commit or the version.
# uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Build ckwart
run: |
call ..\..\setenv.bat
nmake /nologo /e /f ckoker.mak ckwart.exe
if not exist ckwart.exe exit /b 1
move ckwart.exe ..\..\ckwart.exe
shell: cmd
working-directory: ${{ github.workspace }}\kermit\k95\
env:
ROOT: ${{ github.workspace }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: wart-x86
path: ${{ github.workspace }}\ckwart.exe
if-no-files-found: error
retention-days: 1
##############################################################################
# Build with Visual C++ 14.x (2015/2017/2019/2022) #
##############################################################################
# This includes the latest compilers available (2022), plus the most recent
# capable of still targeting Windows XP (2017). All support x86, x86-64, ARM32
# and ARM64.
Build-VisualCxx:
runs-on: windows-latest
needs: [Get-CACerts-Bundle, Prepare-Docs, Build-Wart]
strategy:
matrix:
arch:
- x86
- x64
- x64_arm
- x64_arm64
toolset:
# Note: the 14.0 toolset doesn't really work (just results in 14.4)
- 14.2
- 14.4
exclude:
# The last ARM32 redist was shipped for 14.0 (Visual C++ 2015), but
# newer versions of Visual C++ seem to be able to target it OK. For
# now just use 14.2 same as for x86 and x86-64.
- arch: x64_arm
toolset: 14.4
# No point in building ARM64 targets with anything but the latest as
# the latest hasn't dropped any windows support yet.
- arch: x64_arm64
toolset: 14.2
steps:
- uses: actions/checkout@v4
- name: Select env configuration
run: |
if [ matrix.arch = 'x64_arm' || matrix.arch = 'x64_arm64' ]; then
echo "CK_OPENSSL_VERSION=${{ env.OPENSSL_ARM_VERSION }}" >> "$GITHUB_ENV"
echo "CK_K4W_PATH=." >> "$GITHUB_ENV"
else
echo "CK_OPENSSL_VERSION=${{ env.OPENSSL_VERSION }}" >> "$GITHUB_ENV"
echo "CK_K4W_PATH=kerberos\current\Kerberos" >> "$GITHUB_ENV"
fi
shell: bash
# temporary setup Windows SDK version for 32-bit ARM to 10.0.22621.0 because
# latest SDK version 10.0.26100.0 doesn't contains 32-bit ARM files
- name: Enable Developer Command Prompt
if: matrix.arch == 'x64_arm'
# You may pin to the exact commit or the version.
# uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolset }}
sdk: '10.0.22621.0'
#spectre: # set true to use VC libraries with sepctre mitigations
- name: Enable Developer Command Prompt
if: matrix.arch != 'x64_arm'
# You may pin to the exact commit or the version.
# uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolset }}
#sdk: # use the latest
#spectre: # set true to use VC libraries with sepctre mitigations
##########################################################################
# Build optional dependencies (zlib, openssl, libssh) #
##########################################################################
- name: Cache Optional Dependencies
uses: "./.github/actions/cache"
id: cache-optional-dependencies
with:
path: |
${{github.workspace}}\zlib
${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
${{github.workspace}}\libssh\${{env.LIBSSH_VERSION}}
${{github.workspace}}\libssh\${{env.LIBSSH_VERSION}}-gssapi
${{github.workspace}}\libdes\des
${{github.workspace}}\libdes\Release
${{github.workspace}}\libdes\Debug
${{github.workspace}}\tools
${{github.workspace}}\kerberos\kfw
${{github.workspace}}\rexx\regina
${{github.workspace}}\rexx\rexxre
key: msvc-${{ matrix.toolset }}-${{ matrix.arch }}+zlib-${{env.ZLIB_VERSION}}+openssl-${{env.CK_OPENSSL_VERSION}}+${{env.OPENSSL_MAKE}}+libssh-${{env.LIBSSH_VERSION}}+dynamic+regina-${{env.REGINA_VER}}+rexxre+ver3
nocache: ${{ vars.NOCACHE }}
- name: Get dependencies
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true'
run: |
# Get and unpack zlib
mkdir zlib
cd zlib
echo "Fetching ${{env.ZLIB}}/zlib-${{env.ZLIB_VERSION}}.tar.gz to file zlib-${{env.ZLIB_VERSION}}.tar.gz..."
wget ${{env.ZLIB}}/zlib-${{env.ZLIB_VERSION}}.tar.gz -outfile zlib-${{env.ZLIB_VERSION}}.tar.gz
echo "Cmd is: 7z x zlib-${{env.ZLIB_VERSION}}.tar.gz"
7z x zlib-${{env.ZLIB_VERSION}}.tar.gz
echo "Cmd is: 7z x zlib-${{env.ZLIB_VERSION}}.tar"
7z x zlib-${{env.ZLIB_VERSION}}.tar
ren zlib-${{env.ZLIB_VERSION}} ${{env.ZLIB_VERSION}}
del *.tar
del *.gz
cd ..
# Get and unpack openssl
cd openssl
wget "https://github.com/openssl/openssl/releases/download/openssl-${{ env.CK_OPENSSL_VERSION }}/openssl-${{ env.CK_OPENSSL_VERSION }}.tar.gz" -outfile openssl-${{ env.CK_OPENSSL_VERSION }}.tar.gz
7z x openssl-${{ env.CK_OPENSSL_VERSION }}.tar.gz
7z x openssl-${{ env.CK_OPENSSL_VERSION }}.tar
ren openssl-${{ env.CK_OPENSSL_VERSION }} ${{ env.CK_OPENSSL_VERSION }}
del *.tar
del *.gz
cd ..
# Get and unpack libssh
cd libssh
wget ${{env.LIBSSH_SOURCE}}libssh-${{env.LIBSSH_VERSION}}.tar.xz -outfile libssh-${{env.LIBSSH_VERSION}}.tar.xz
7z x libssh-${{env.LIBSSH_VERSION}}.tar.xz
7z x libssh-${{env.LIBSSH_VERSION}}.tar
ren libssh-${{env.LIBSSH_VERSION}} ${{env.LIBSSH_VERSION}}
del *.tar
del *.xz
cd ${{env.LIBSSH_VERSION}}
mkdir build
cd ..
cd ..
# Get and unpack libdes
cd libdes
wget ${{env.LIBDES}} -outfile libdes.tar.gz
7z x libdes.tar.gz
7z x libdes.tar
del *.tar
del *.gz
cd ..
# CD into the tools directory
mkdir tools
cd tools
# Get and unpack nasm
wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win32/nasm-2.15.05-win32.zip -outfile nasm-2.15.05-win32.zip
7z x nasm-2.15.05-win32.zip
ren nasm-2.15.05 nasm
del *.zip
dir
cd nasm
dir
cd ..
# Get and unpack JOM
mkdir jom
cd jom
wget ${{env.JOM}} -outfile jom.zip
7z x jom.zip
del *.zip
cd ..
# Get KFW
echo Get KFW...
mkdir kerberos
cd kerberos
if ("${{matrix.arch}}" -eq "x86") {
echo x86 platform: ${{env.KFW_x86}}
wget ${{env.KFW_x86}} -outfile kfw.msi
} else {
echo x86-64 platform: ${{env.KFW_x86}}
wget ${{env.KFW_x86_64}} -outfile kfw.msi
}
start-process msiexec -argumentlist "/a kfw.msi /qn TARGETDIR=${{github.workspace}}\kerberos\kfw" -wait
dir ${{github.workspace}}\kerberos\kfw
cd ..
# CD out of the tools directory
cd ..
cd rexx
# Get Regina REXX
mkdir regina
cd regina
wget ${{env.REGINA_REXX}} -outfile regina.zip
7z x regina.zip
del regina.zip
dir
cd ..
# Get RexxRE
wget ${{env.REXXRE}} -outfile rexxre.zip
7z x rexxre.zip
del rexxre.zip
# CD out of the rexx directory
cd ..
# Install perl modules required by OpenSSL build
cpan -i Text::Template
shell: powershell
- name: Build zlib (x86/x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
run: |
cd zlib\${{env.ZLIB_VERSION}}
cmake .
nmake -f win32\Makefile.msc
- name: Build zlib (arm32/arm64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x64_arm' || matrix.arch == 'x64_arm64')
shell: cmd
run: |
cd zlib\${{env.ZLIB_VERSION}}
cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
nmake
- name: Build openssl (x86)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x86'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
echo %PATH%
cd openssl\${{env.CK_OPENSSL_VERSION}}
perl Configure VC-WIN32 zlib-dynamic --with-zlib-include=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} ${{env.OPENSSL_EXTRA_BUILD_FLAGS}}
REM The linker by default marks the subsystem version too high for XP
REM and there isn't a way to fix that from the configure script, so
REM do it the hard way.
sed -i "s/subsystem:console/subsystem:console,5.01/g" makefile
${{env.OPENSSL_MAKE}}
- name: Build openssl (x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
echo %PATH%
cd openssl\${{env.CK_OPENSSL_VERSION}}
perl Configure VC-WIN64A zlib-dynamic --with-zlib-include=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} ${{env.OPENSSL_EXTRA_BUILD_FLAGS}}
REM The linker by default marks the subsystem version too high for XP
REM and there isn't a way to fix that from the configure script, so
REM do it the hard way.
sed -i "s/subsystem:console/subsystem:console,5.01/g" makefile
${{env.OPENSSL_MAKE}}
- name: Build openssl (ARM)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
echo %PATH%
cd openssl\${{env.CK_OPENSSL_VERSION}}
perl Configure VC-WIN32-ARM zlib-dynamic --with-zlib-include=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} ${{env.OPENSSL_EXTRA_BUILD_FLAGS}}
${{env.OPENSSL_MAKE}}
- name: Build openssl (ARM-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm64'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom;${{github.workspace}}\tools\nasm
echo %PATH%
cd openssl\${{env.CK_OPENSSL_VERSION}}
perl Configure VC-WIN64-ARM zlib-dynamic --with-zlib-include=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} ${{env.OPENSSL_EXTRA_BUILD_FLAGS}}
${{env.OPENSSL_MAKE}}
- name: Build libssh (x86/x86-64, Vista+)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
env:
ROOT: ${{ github.workspace }}
run: |
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
set zlib_root_override=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}}
call setenv.bat
cd ${{ github.workspace }}\libssh
REM /M - output directory for binaries and libraries (Move to)
REM /C - clean build
REM /R - release build
REM /W - build for Windows Vista or newer (not XP)
call build.bat /M out /C /R /W ${{env.LIBSSH_VERSION}}
- name: Build libssh (x86/x86-64, Vista+, GSSAPI)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64')
shell: cmd
env:
ROOT: ${{ github.workspace }}
run: |
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
set zlib_root_override=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}}
set k4w_root_override=${{github.workspace}}\${{ env.CK_K4W_PATH }}
call setenv.bat
cd ${{ github.workspace }}\libssh
REM /M - output directory for binaries and libraries (Move to)
REM /N - Name suffix (eg, "/N g" produces "sshg.dll" and "sshg.lib")
REM /G - GSSAPI build
REM /C - clean build
REM /R - release build
REM /W - build for Windows Vista or newer (not XP)
call build.bat /M out /N g /G /C /R /W ${{env.LIBSSH_VERSION}}
- name: Build libssh (x86/x86-64, XP)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
shell: cmd
env:
ROOT: ${{ github.workspace }}
run: |
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
set zlib_root_override=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}}
call setenv.bat
cd ${{ github.workspace }}\libssh
REM /M - output directory for binaries and libraries (Move to)
REM /N - Name suffix (eg, "/N x" produces "sshx.dll" and "sshx.lib")
REM /G - GSSAPI build
REM /C - clean build
REM /R - release build
REM /X - build for Windows XP (removes a low impact security fix in 0.10.6, and disables thread local storage)
call build.bat /M out /N x /C /R /X ${{env.LIBSSH_VERSION}}
- name: Build libssh (x86/x86-64, XP, GSSAPI)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && (matrix.arch == 'x86' || matrix.arch == 'x64') && (matrix.toolset == '14.0' || matrix.toolset == '14.1' || matrix.toolset == '14.2')
shell: cmd
env:
ROOT: ${{ github.workspace }}
run: |
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
set zlib_root_override=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}}
set k4w_root_override=${{github.workspace}}\${{ env.CK_K4W_PATH }}
call setenv.bat
cd ${{ github.workspace }}\libssh
REM /M - output directory for binaries and libraries (Move to)
REM /N - Name suffix (eg, "/N xg" produces "sshxg.dll" and "sshxg.lib")
REM /G - GSSAPI build
REM /C - clean build
REM /R - release build
REM /X - build for Windows XP (removes a low impact security fix in 0.10.6, and disables thread local storage)
call build.bat /M out /N gx /G /C /R /X ${{env.LIBSSH_VERSION}}
# zlib is currently disabled for ARM builds as it doesn't currently build for ARM
# On ARM32 we've got to specify the list of standard libraries ourselves as for some unknown reason advapi32.lib gets left off by default.
- name: Build libssh (arm32)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm'
shell: powershell
run: |
cd libssh\${{env.LIBSSH_VERSION}}\build
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}\ -DZLIB_ROOT:PATH=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} -DWITH_DSA=ON -DCMAKE_C_STANDARD_LIBRARIES="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib"
nmake
# zlib is currently disabled for ARM builds as it doesn't currently build for ARM
- name: Build libssh (arm64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm64'
shell: powershell
run: |
cd libssh\${{env.LIBSSH_VERSION}}\build
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}\ -DZLIB_ROOT:PATH=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}} -DWITH_DSA=ON
nmake
- name: Build libdes
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true'
shell: cmd
run: |
set PATH=%PATH%;${{github.workspace}}\tools\jom
set MAKE=jom
cd libdes\
call mknt.bat
- name: Build Regina REXX (x86)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x86'
shell: cmd
run: |
set REGINA_SRCDIR=${{github.workspace}}\rexx\regina
set PLATFORM=x86
cd %REGINA_SRCDIR%
nmake -f makefile.win.vc
if not exist regina.dll exit /b 1
mkdir include
cd include
copy ..\rexxsaa.h
cd ..
mkdir lib
cd lib
copy ..\regina.lib
cd ..
echo Building RexxRE
cd %REGINA_SRCDIR%\..\rexxre
patch -p1 < ..\rexxre.patch
nmake -f Makefile.NT
if not exist rexxre.dll exit /b 1
cd ..
- name: Build Regina REXX (x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64'
shell: cmd
run: |
set REGINA_SRCDIR=${{github.workspace}}\rexx\regina
set PLATFORM=x64
cd %REGINA_SRCDIR%
nmake -f makefile.win.vc
if not exist regina.dll exit /b 1
mkdir include
cd include
copy ..\rexxsaa.h
cd ..
mkdir lib
cd lib
copy ..\regina.lib
cd ..
echo Building RexxRE
cd %REGINA_SRCDIR%\..\rexxre
patch -p1 < ..\rexxre.patch
nmake -f Makefile.NT
if not exist rexxre.dll exit /b 1
cd ..
# TODO: Regina REXX 3.9.6 doesn't support being cross-compiled to
# an incompatible target architecture:
#
# .\trexx D:\a\ckwin\ckwin\rexx\regina\common\fixrc.rexx D:\a\ckwin\ckwin\rexx\regina\rexxwinexe.rc .\rexxexe.rc 3.9.6 arm64 regina "29 Apr 2024"
# NMAKE : fatal error U1045: spawn failed for '.\trexx.EXE' : 0x800700d8
# This version of %1 is not compatible with the version of Windows
# you're running. Check your computer's system information and then
# contact the software publisher.
#
# - name: Build Regina REXX (arm64)
# if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64_arm64'
# shell: cmd
# run: |
# set REGINA_SRCDIR=${{github.workspace}}\rexx\regina
# set PLATFORM=arm64
#
# cd %REGINA_SRCDIR%
#
# nmake -f makefile.win.vc
# if not exist regina.dll exit /b 1
#
# mkdir include
# cd include
# copy ..\rexxsaa.h
# cd ..
# mkdir lib
# cd lib
# copy ..\regina.lib
# cd ..
#
# echo Building RexxRE
# cd %REGINA_SRCDIR%\..\rexxre
# patch -p1 < ..\rexxre.patch
# nmake -f Makefile.NT
# cd ..
- name: Fetch x86 wart
uses: actions/download-artifact@v4
if: matrix.arch != 'x86' && matrix.arch != 'x64'
with:
name: wart-x86
path: ${{ github.workspace }}
##########################################################################
# Build K95, K95G and other bits for redistribution #
##########################################################################
- name: Full Build
run: |
set k4w_root_override=${{github.workspace}}\${{ env.CK_K4W_PATH }}
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
set zlib_root_override=${{github.workspace}}\zlib\${{env.ZLIB_VERSION}}
set libssh_root_override=${{github.workspace}}\libssh\${{env.LIBSSH_VERSION}}
set libssh_build_override=%libssh_root_override%\build
set rexx_root_override=${{github.workspace}}\rexx\regina\
call ..\setenv.bat
set PATH=%PATH%;${{github.workspace}}\tools\jom
set MAKE=jom
REM Don't make PDBs as it causes intermittent problems with JOM that
REM /FS *should* solve, but seemingly doesn't.
REM TODO: Take another look at this sometime and see if we can fix it
REM properly.
set CKB_MAKE_PDB=no
REM If the target arch is incompatible with the host arch, use
REM the x86 version of ckwart.exe which should have been placed
REM in the workplace previously, rather than trying to use a
REM version of wart built for the target architecture.
if "%CKB_CROSS_COMPATIBLE%" == "no" set CKB_USE_WART=yes
if "%CKB_CROSS_COMPATIBLE%" == "no" set WART=${{github.workspace}}\ckwart.exe
cd p95
call mknt.bat
cd ..\k95
REM We only do dynamic SSH for x86 and x86-64 as at this time ARM only
REM has the single non-GSSAPI SSH backend to choose from.
if "%CKB_TARGET_ARCH%" == "x86" goto :build_ssh_dlls
if "%CKB_TARGET_ARCH%" == "AMD64" goto :build_ssh_dlls
goto :build_main
REM Support and build multiple SSH backends
:build_ssh_dlls
echo Enabling Dynamic SSH support
set CKF_DYNAMIC_SSH=yes
REM Vista+, GSSAPI-enabled
set SSH_LIB=sshg.lib
set CKF_SSH_DLL_VARIANT=g
call mksshdll.bat
ren k95ssh.dll k95sshg.dll
ren k95ssh.pdb k95sshg.pdb
del k95ssh.res
if "%CKB_XP_COMPATIBLE%" NEQ "yes" goto :noxp
REM XP only, no-GSSAPI
set SSH_LIB=sshx.lib
set CKF_SSH_DLL_VARIANT=x
call mksshdll.bat
ren k95ssh.dll k95sshx.dll
ren k95ssh.pdb k95sshx.pdb
del k95ssh.res
REM XP, GSSAPI-enabled
set SSH_LIB=sshgx.lib
set CKF_SSH_DLL_VARIANT=gx
call mksshdll.bat
ren k95ssh.dll k95sshgx.dll
ren k95ssh.pdb k95sshgx.pdb
del k95ssh.res
:noxp
REM Vista+, no-GSSAPI
REM built as part of the regular build (mk.bat)
set SSH_LIB=ssh.lib
set CKF_SSH_DLL_VARIANT=
:build_main
call mk.bat
call mkdist.bat
REM Check outputs
set MISSING_BUILD_RESULTS=
for %%y in (${{env.STANDARD_BUILD_OUTPUTS}}) do (
if not exist dist\%%y echo Build result not found: %%y
if not exist dist\%%y set MISSING_BUILD_RESULTS=%MISSING_BUILD_RESULTS% %%y
if not exist dist\%%y set FAILED=yes
)
if "%MISSING_BUILD_RESULTS%" NEQ "" echo Missing build outputs: %MISSING_BUILD_RESULTS%
if "%MISSING_BUILD_RESULTS%" NEQ "" echo One or more expected outputs are missing - failing build
if "%MISSING_BUILD_RESULTS%" NEQ "" exit /b 1
shell: cmd
working-directory: ${{ github.workspace }}\kermit\
env:
ROOT: ${{ github.workspace }}
- name: Fetch CA Certs bundle
uses: actions/download-artifact@v4
with:
name: ca_certs
path: ${{ github.workspace }}\kermit\k95\dist
- name: Fetch Docs
uses: actions/download-artifact@v4
with:
name: markdown-docs
path: ${{ github.workspace }}\kermit\k95\dist
- name: Prepare Artifact
shell: cmd
working-directory: ${{ github.workspace }}\kermit\k95
run: |
move dist ${{ github.workspace }}\ckwin
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: k95-vc${{ matrix.toolset }}-${{ matrix.arch }}
path: ${{ github.workspace }}\ckwin
if-no-files-found: error
retention-days: 7
##############################################################################
# Build with Windows 7 Platform SDK version 7.1 (Visual C++ 2010) #
##############################################################################
# This is the last compiler that can target Itanium. Due to its lack of C99
# support, builds with Visual C++ 2010 and older don't include SSH support.
# OpenSSL 1.1.1t is supported however.
Build-PSDK71:
runs-on: windows-latest
needs: [Get-CACerts-Bundle, Prepare-Docs, Build-Wart]
strategy:
matrix:
arch:
- ia64
#- x86
#- x64
steps:
- uses: actions/checkout@v4
- name: Select env configuration
run: echo "CK_OPENSSL_VERSION=${{ env.OPENSSL_VERSION }}" >> "$GITHUB_ENV"
shell: bash
##########################################################################
# Fetch the compiler #
##########################################################################
- name: Cache Compiler
uses: "./.github/actions/cache"
id: cache-compiler
with:
path: |
${{github.workspace}}\Microsoft SDKs
${{github.workspace}}\Microsoft Visual Studio 10.0
${{github.workspace}}\vc10.cmd
${{github.workspace}}\vcredist_x86.exe
key: platform-sdk-71-compiler+sdk+redist
nocache: ${{ vars.NOCACHE }}
- name: Get Windows 7 Platform SDK v7.1
if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
wget https://ftp.zx.net.nz/pub/dev/WinSDK/win7-7.1-dn4/win7-7.1-sdk-vc.7z -outfile win7-7.1-sdk-vc.7z
7z x win7-7.1-sdk-vc.7z
wget https://ftp.zx.net.nz/pub/dev/WinSDK/win7-7.1-dn4/win7-7.1-sdk-psdk.7z -outfile win7-7.1-sdk-psdk.7z
7z x win7-7.1-sdk-psdk.7z
del *.7z
wget http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe -outfile vcredist_x86.exe
shell: powershell
- name: Install the Visual C++ 2010 Runtime
run: vcredist_x86.exe /q /norestart
shell: cmd
working-directory: ${{ github.workspace }}
##########################################################################
# Build optional dependencies (openssl, libdes) #
##########################################################################
- name: Cache Optional Dependencies
uses: "./.github/actions/cache"
id: cache-optional-dependencies
with:
path: |
${{github.workspace}}\zlib
${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
${{github.workspace}}\libssh
${{github.workspace}}\libdes\des
${{github.workspace}}\libdes\Release
${{github.workspace}}\libdes\Debug
${{github.workspace}}\tools
key: platform-sdk-71-optdepts-${{ matrix.arch }}+nasm+openssl-${{env.CK_OPENSSL_VERSION}}+libdes+v3
nocache: ${{ vars.NOCACHE }}
- name: Get dependencies
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true'
run: |
# Get and unpack openssl
cd openssl
wget https://github.com/openssl/openssl/releases/download/openssl-${{env.CK_OPENSSL_VERSION}}/openssl-${{env.CK_OPENSSL_VERSION}}.tar.gz -outfile openssl-${{env.CK_OPENSSL_VERSION}}.tar.gz
7z x openssl-${{env.CK_OPENSSL_VERSION}}.tar.gz
7z x openssl-${{env.CK_OPENSSL_VERSION}}.tar
ren openssl-${{env.CK_OPENSSL_VERSION}} ${{env.CK_OPENSSL_VERSION}}
del *.tar
del *.gz
cd ..
# Get and unpack libdes
cd libdes
wget ${{env.LIBDES}} -outfile libdes.tar.gz
7z x libdes.tar.gz
7z x libdes.tar
del *.tar
del *.gz
cd ..
# Get and unpack nasm
mkdir tools
cd tools
wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win32/nasm-2.15.05-win32.zip -outfile nasm-2.15.05-win32.zip
7z x nasm-2.15.05-win32.zip
ren nasm-2.15.05 nasm
del *.zip
dir
cd nasm
dir
cd ..
cd ..
# Get and unpack JOM
cd ${{github.workspace}}\tools
mkdir jom
cd jom
wget ${{env.JOM}} -outfile jom.zip
7z x jom.zip
del *.zip
cd ..
cd ..
# Install perl modules required by OpenSSL build
cpan -i Text::Template
shell: powershell
- name: Build openssl (ia64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'ia64'
shell: cmd
run: |
SET PlatformToolset=100
set PATH=%PATH%;${{github.workspace}}\tools\jom
call vc10.cmd /release /xp /${{matrix.arch}}
cd openssl\${{env.CK_OPENSSL_VERSION}}
perl Configure VC-WIN64I -D"_WIN32_WINNT=0x502"
REM The perl configure script doesn't work quite right for cross-compiling to IA64
REM it leaves the /machine flag off the link flags, so we'll just add it on ourselves.
sed -i "s/^LDFLAGS=\/nologo.*/& \/machine:ia64/g" makefile
nmake
- name: Build openssl (x86-64)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x64'
shell: cmd
run: |
SET PlatformToolset=100
call vc10.cmd /release /xp /${{matrix.arch}}
cd openssl\${{env.CK_OPENSSL_VERSION}}
set PATH=%PATH%;${{github.workspace}}\tools\nasm;${{github.workspace}}\tools\jom
perl Configure VC-WIN64A -D"_WIN32_WINNT=0x502"
REM The perl configure script doesn't work quite right for cross-compiling to x64
REM it leaves the /machine flag off the link flags, so we'll just add it on ourselves.
sed -i "s/^LDFLAGS=\/nologo.*/& \/machine:x64/g" makefile
nmake
- name: Build openssl (x86)
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true' && matrix.arch == 'x86'
shell: cmd
run: |
SET PlatformToolset=100
call vc10.cmd /release /xp /${{matrix.arch}}
cd openssl\${{env.CK_OPENSSL_VERSION}}
set PATH=%PATH%;${{github.workspace}}\tools\nasm;${{github.workspace}}\tools\jom
perl Configure VC-WIN32 -D"_WIN32_WINNT=0x502"
nmake
- name: Build libdes
if: steps.cache-optional-dependencies.outputs.cache-hit != 'true'
shell: cmd
run: |
SET PlatformToolset=100
call vc10.cmd /release /xp /${{matrix.arch}}
set PATH=%PATH%;${{github.workspace}}\tools\jom
set MAKE=jom
cd libdes
call mknt.bat
- name: Fetch x86 wart
uses: actions/download-artifact@v4
if: matrix.arch == 'ia64'
with:
name: wart-x86
path: ${{ github.workspace }}
##########################################################################
# Build K95, K95G and other bits for redistribution #
##########################################################################
- name: Full Build
run: |
echo Configure Platform SDK Build Environment...
SET PlatformToolset=100
call vc10.cmd /release /xp /${{matrix.arch}}
echo Configure build environment...
set openssl_root_override=${{github.workspace}}\openssl\${{env.CK_OPENSSL_VERSION}}
call setenv.bat
set PATH=%PATH%;${{github.workspace}}\tools\jom
set MAKE=jom
if "%CKB_CROSS_COMPATIBLE%" == "no" set CKB_USE_WART=yes
if "%CKB_CROSS_COMPATIBLE%" == "no" set WART=${{github.workspace}}\ckwart.exe
echo Run Build...
cd kermit\p95
call mknt.bat
cd ..\k95
call mk.bat
call mkdist.bat
echo Check outputs...
set MISSING_BUILD_RESULTS=
for %%y in (${{env.STANDARD_BUILD_OUTPUTS}}) do (
if not exist dist\%%y echo Build result not found: %%y
if not exist dist\%%y set MISSING_BUILD_RESULTS=%MISSING_BUILD_RESULTS% %%y
if not exist dist\%%y set FAILED=yes
)
if "%MISSING_BUILD_RESULTS%" NEQ "" echo Missing build outputs: %MISSING_BUILD_RESULTS%
if "%MISSING_BUILD_RESULTS%" NEQ "" echo One or more expected outputs are missing - failing build
if "%MISSING_BUILD_RESULTS%" NEQ "" exit /b 1