To slop SSL away (#191)

* windows 98/nt4, slopped openssl away

* one (1) roadblock that it can't figure out

* fixed maybe

* fix dos?

* fix dos? (2)

* ts is gonna be slow

* No need to compress anymore

* No need to compress anymore (2)

* deslop

The main problem with AI models, even today, is that they're very shortsighted. They're too focused on the thing working now than thinking about how maintainable it will be later. As such, you get duplicated code, as well as comments that are geared towards what it's doing right then and there (as if it's an advertisement of it's services) rather than improving the readability of the code. Always check your diffs.

* Update workflows

* Update freebsd.yml

* Update README.md
This commit is contained in:
TheTank20 authored and GitHub committed 2026-10-30 16:53:17 -04:00
1 parent 4a6cb3cd31
commit f9100e0871
41 files changed
+4758 -1743

No files matched your search

+6 -171
View File
@@ -33,19 +33,18 @@ env:
CC: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc
CXX: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-g++
CMAKE_FIND_ROOT_PATH: ${{ github.workspace }}/djgpp
WATT_ROOT: ${{ github.workspace }}/djgpp/watt32
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Tree
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup build environment
run: |
sudo apt -y update
sudo apt -y install build-essential cmake wget 7zip git flex libfl-dev nasm libslang2-dev pkg-config libslang2-modules gcc-multilib dosbox tree
sudo apt -y install build-essential cmake wget 7zip git gcc-multilib dosbox tree
- name: Download and Setup DJGPP Toolchain
run: |
@@ -54,41 +53,7 @@ jobs:
tar xjf djgpp-linux64-gcc1220.tar.bz2
cd ${{ github.workspace }}/djgpp
tree . -S
git clone https://github.com/UMSKT/Watt-32.git watt32
cd watt32/util
make clean && make linux
cd ../src
source ${{ github.workspace }}/djgpp/setenv
./configur.sh djgpp
make -f djgpp.mak
ln -s ${WATT_ROOT}/lib/libwatt.a ${{ github.workspace }}/djgpp/lib
- name: Cache OpenSSL 3.1.2
uses: actions/cache/restore@v4
id: cache-openssl
with:
path: |
${{ github.workspace }}/djgpp
key: openssl-3.1.2-${{ hashFiles('**/CMakeLists.txt') }}
- name: Checkout and Cross Compile OpenSSL 3.1.2
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: |
git clone https://github.com/UMSKT/openssl.git openssl
pushd openssl
source ${{ github.workspace }}/djgpp/setenv
./Configure 386 no-threads no-tests no-sse2 no-asm -DOPENSSL_DEV_NO_ATOMICS -mno-mmx -mno-sse -mno-sse2 -march=i386 --prefix=${{ github.workspace }}/djgpp DJGPP
make && make install_sw
popd
- name: Save OpenSSL 3.1.2
if: steps.cache-openssl.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/djgpp
key: openssl-3.1.2-${{ hashFiles('**/CMakeLists.txt') }}
- name: Download stub
run: |
wget https://web.archive.org/web/20250308092209/https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/system/cwsdpmi/csdpmi7b.zip -O CSDPMI7B.ZIP
@@ -99,7 +64,7 @@ jobs:
run: |
source ${{ github.workspace }}/djgpp/setenv
pushd build
cmake ../ -D DJGPP_WATT32=${WATT_ROOT}/lib/libwatt.a -D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH} -D CWSDSTUB_LOCATION=/home/runner/dpmibin/CWSDSTUB.EXE -D DJGPP_BIN_LOCATION=/home/runner/work/UMSKT/UMSKT/djgpp/i586-pc-msdosdjgpp/bin
cmake ../ -D DJGPP=ON -D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH} -D CWSDSTUB_LOCATION=/home/runner/dpmibin/CWSDSTUB.EXE -D DJGPP_BIN_LOCATION=/home/runner/work/UMSKT/UMSKT/djgpp/i586-pc-msdosdjgpp/bin
make
- name: Setup DOSBox test environment
@@ -145,7 +110,7 @@ jobs:
- name: Run tests in DOSBox
run: |
cd dosbox_test
timeout 30s dosbox -conf dosbox.conf -nogui -exit
timeout 2m dosbox -conf dosbox.conf -nogui -exit
# Check if the test completed successfully
if [ ! -f DONE.TXT ]; then
echo "Tests did not complete successfully"
@@ -199,137 +164,7 @@ jobs:
mv build/umskt.exe build/actions_upload/
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-DOS-x86
path: build/actions_upload
compress:
needs: build
if: success()
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Setup test environment
run: |
sudo apt -y update
sudo apt -y install dosbox
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: UMSKT-DOS-x86
path: .
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Compress binary
shell: pwsh
run: |
upx umskt.exe --best --ultra-brute -v
- name: Setup DOSBox test environment
run: |
mkdir -p dosbox_test
cp umskt.exe dosbox_test/
# Download DPMI server directly
# wget https://github.com/UMSKT/winactiontest/raw/refs/heads/main/CWSDPMI.EXE -O dosbox_test/CWSDPMI.EXE
# Create test batch file
cat > dosbox_test/test.bat << EOL
@echo off
echo Running test 1...
umskt.exe -b 2C -c 365 -s 069420,999999 > TEST1.TXT
if errorlevel 1 goto error
echo Running test 2...
umskt.exe -b 5A -c 640 -s 069420,999999 > TEST2.TXT
if errorlevel 1 goto error
echo Running test 3...
umskt.exe -i 253286028742154311079061239762245184619981623171292574 > TEST3.TXT
if errorlevel 1 goto error
echo Tests completed > DONE.TXT
goto end
:error
echo Test failed > ERROR.TXT
:end
exit
EOL
# Create DOSBox configuration
cat > dosbox_test/dosbox.conf << EOL
[sdl]
nosound=true
[cpu]
cputype=386
core=dynamic
cycles=max
[autoexec]
mount c .
c:
test.bat
exit
EOL
- name: Run tests in DOSBox
run: |
cd dosbox_test
timeout 30s dosbox -conf dosbox.conf -nogui -exit
# Check if the test completed successfully
if [ ! -f DONE.TXT ]; then
echo "Tests did not complete successfully"
if [ -f ERROR.TXT ]; then
echo "Test execution failed"
fi
if [ -f TEST1.TXT ]; then
echo "Test 1 output:"
cat TEST1.TXT
fi
if [ -f TEST2.TXT ]; then
echo "Test 2 output:"
cat TEST2.TXT
fi
if [ -f TEST3.TXT ]; then
echo "Test 3 output:"
cat TEST3.TXT
fi
exit 1
fi
# Verify test outputs
if [ ! -f TEST1.TXT ] || [ ! -f TEST2.TXT ] || [ ! -f TEST3.TXT ]; then
echo "Test output files missing"
exit 1
fi
# Check test results - looking for key format patterns
if ! grep -qE '[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}' TEST1.TXT || \
! grep -qE '[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}' TEST2.TXT || \
! grep -qE '[0-9]{6}-[0-9]{6}-[0-9]{6}-[0-9]{6}-[0-9]{6}-[0-9]{6}-[0-9]{6}' TEST3.TXT; then
echo "Tests failed - unexpected output format"
echo "Test 1 output:"
cat TEST1.TXT
echo "Test 2 output:"
cat TEST2.TXT
echo "Test 3 output:"
cat TEST3.txt
exit 1
else
echo "All tests passed successfully"
echo "Test 1 output:"
cat TEST1.TXT
echo "Test 2 output:"
cat TEST2.TXT
echo "Test 3 output:"
cat TEST3.TXT
fi
- name: Move executable to upload directory
run: |
mkdir actions_upload
mv umskt.exe actions_upload/
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
with:
name: UMSKT-DOS-x86-Compressed
path: actions_upload
path: build/actions_upload
+9 -9
View File
@@ -21,12 +21,12 @@
name: FreeBSD
on:
#push:
# branches: [ "*" ]
# paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip
#pull_request:
# branches: [ "*" ]
# paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip
push:
branches: [ "*" ]
paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip
pull_request:
branches: [ "*" ]
paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip
workflow_dispatch:
@@ -35,7 +35,7 @@
runs-on: ubuntu-latest
name: build-x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Build & Test in FreeBSD
id: test
@@ -43,7 +43,7 @@
with:
usesh: true
prepare: |
pkg install -y cmake openssl git bash
pkg install -y cmake git bash
run: |
mkdir -p build
@@ -63,7 +63,7 @@
mv build/umskt build/actions_upload/umskt
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-FreeBSD
path: build/actions_upload
+9 -12
View File
@@ -46,7 +46,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout Source Tree
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup latest Alpine Linux
if: ${{ matrix.use_alpine }}
@@ -58,9 +58,6 @@ jobs:
cmake
git
musl-dev
openssl-dev
openssl-libs-static
zlib-dev
arch: ${{ matrix.arch }}
shell-name: alpine-target.sh
@@ -68,11 +65,11 @@ jobs:
if: ${{ !matrix.use_alpine }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libssl-dev zlib1g-dev
sudo apt-get install -y build-essential cmake git
- name: Configure and build UMSKT (Alpine)
if: ${{ matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=ON CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
@@ -80,7 +77,7 @@ jobs:
- name: Configure and build UMSKT (Ubuntu)
if: ${{ !matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=ON CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
@@ -114,14 +111,14 @@ jobs:
mv build/umskt build/actions_upload/umskt
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-Linux-${{ matrix.arch }}-static
path: build/actions_upload
- name: Configure and build static internal deps UMSKT (Alpine)
if: ${{ matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
@@ -129,7 +126,7 @@ jobs:
- name: Configure and build static internal deps UMSKT (Ubuntu)
if: ${{ !matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=OFF CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
@@ -159,7 +156,7 @@ jobs:
- name: Configure and build shared deps UMSKT (Alpine)
if: ${{ matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
@@ -167,7 +164,7 @@ jobs:
- name: Configure and build shared deps UMSKT (Ubuntu)
if: ${{ !matrix.use_alpine }}
uses: threeal/cmake-action@7ef2eb8da6e5ec0a6de6b1ddc96987080bed06e8
uses: threeal/cmake-action@v1
with:
options: MUSL_STATIC=OFF BUILD_SHARED_LIBS=ON CMAKE_POLICY_VERSION_MINIMUM=3.5
run-build: true
+5 -30
View File
@@ -39,43 +39,18 @@ jobs:
- arch: arm64
steps:
- name: Checkout Source Tree
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install Rosetta
if: matrix.arch == 'x86_64'
run: |
sudo softwareupdate --install-rosetta --agree-to-license || true
- name: Install Homebrew for x86_64
if: matrix.arch == 'x86_64'
env: { NONINTERACTIVE: 1 }
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install x86_64 OpenSSL
if: matrix.arch == 'x86_64'
run: |
arch -x86_64 /usr/local/bin/brew install openssl@3
echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig" >> $GITHUB_ENV
- name: Install arm64 OpenSSL
if: matrix.arch == 'arm64'
run: |
brew install openssl@3
echo "OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig" >> $GITHUB_ENV
- name: Configure and build UMSKT
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=Release .. \
-DCMAKE_OSX_ARCHITECTURES=${{matrix.arch}} \
-DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR \
-DOPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \
-DOPENSSL_USE_STATIC_LIBS=TRUE \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
make
@@ -97,7 +72,7 @@ jobs:
./umskt -i 253286028742154311079061239762245184619981623171292574
- name: Upload platform-specific build
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-macOS-${{ matrix.arch }}
path: build/actions_upload
@@ -107,12 +82,12 @@ jobs:
runs-on: macos-latest
steps:
- name: Download x86_64 slice
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: UMSKT-macOS-x86_64
path: x86
- name: Download arm64 slice
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: UMSKT-macOS-arm64
path: arm
@@ -123,7 +98,7 @@ jobs:
lipo -create x86/umskt arm/umskt -output fat/umskt
lipo -info fat/umskt
- name: Upload universal build
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: UMSKT-macOS-universal
path: fat
+3 -57
View File
@@ -38,11 +38,9 @@ jobs:
include:
# - arch: arm32
# arch_compilename: amd64_arm
# vcpkg_arch: arm-windows-static
# cmake_arch: ARM
- arch: arm64
arch_compilename: amd64_arm64
vcpkg_arch: arm64-windows-static
cmake_arch: ARM64
steps:
- name: Setup MSVC for ${{ matrix.arch }}
@@ -51,57 +49,7 @@ jobs:
arch: ${{ matrix.arch_compilename }}
- name: Checkout Source Tree
uses: actions/checkout@v4
- name: Cache OpenSSL Binaries
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}-OpenSSL-MSVC-${{ matrix.arch }}
key: openssl-1.1.1-${{ matrix.arch }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Checkout and Compile OpenSSL v1.1.1
shell: pwsh
run: |
git clone https://github.com/UMSKT/openssl --branch OpenSSL_1_1_1-stable --depth 1 openssl-src
cd openssl-src
# Install Perl if needed
choco install strawberryperl -y
# Configure and build OpenSSL for ARM32
$env:PATH = "C:\Strawberry\perl\bin;$env:PATH"
# First set up Visual Studio environment
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$vcvarsall = Join-Path $vsPath "VC\Auxiliary\Build\vcvarsall.bat"
$vcTarget = ""
if ("${{ matrix.arch}}" -eq "arm32") {
$vcTarget = "VC-WIN32-ARM"
} else {
$vcTarget = "VC-WIN64-ARM"
}
# Configure OpenSSL
perl Configure $vcTarget no-shared no-asm no-engine --prefix="$env:GITHUB_WORKSPACE/OpenSSL-MSVC-${{ matrix.arch }}"
# Build using MSVC ARM32 tools
cmd /c "call `"$vcvarsall`" ${{matrix.arch_compilename}} && nmake && nmake install_sw"
cd ..
- name: Save OpenSSL Binaries
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/OpenSSL-MSVC-${{ matrix.arch }}
key: openssl-1.1.1-${{ matrix.arch }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Set OpenSSL Environment
shell: pwsh
run: |
echo "OPENSSL_ROOT=$env:GITHUB_WORKSPACE/OpenSSL-MSVC-${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "OPENSSL_LIBDIR=lib" | Out-File -FilePath $env:GITHUB_ENV -Append
uses: actions/checkout@v7
- name: Configure UMSKT
shell: pwsh
@@ -109,8 +57,6 @@ jobs:
cmake -G "Visual Studio 18 2026" `
-A ${{ matrix.cmake_arch }} `
-DWINDOWS_ARM=ON `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_arch }} `
-DCMAKE_POLICY_VERSION_MINIMUM="3.5" `
.
@@ -120,7 +66,7 @@ jobs:
cmake --build . --config Release
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-WinNT-${{ matrix.arch }}
path: Release/umskt.exe
@@ -134,7 +80,7 @@ jobs:
arch: [arm64]
steps:
- name: Download ARM64 artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: UMSKT-WinNT-${{ matrix.arch }}
path: .
+31 -153
View File
@@ -61,85 +61,17 @@ jobs:
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
- name: Checkout Source Tree
uses: actions/checkout@v4
- name: Cache OpenSSL 1.1.1
uses: actions/cache/restore@v4
id: cache-openssl
with:
path: |
${{ github.workspace }}/OpenSSL-TDM-${{ matrix.arch }}
key: openssl-1.1.1-${{ matrix.arch }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Setup MSYS2
if: steps.cache-openssl.outputs.cache-hit != 'true'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.arch == 'x86' && 'MINGW32' || 'MINGW64' }}
update: true
install: >-
mingw-w64-${{ matrix.arch == 'x86' && 'i686' || 'x86_64' }}-gcc
mingw-w64-${{ matrix.arch == 'x86' && 'i686' || 'x86_64' }}-make
mingw-w64-x86_64-perl
perl
git
- name: Checkout and Compile OpenSSL 1.1.1
if: steps.cache-openssl.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
# Clone UMSKT's OpenSSL fork
echo "Cloning UMSKT OpenSSL fork..."
git clone https://github.com/UMSKT/openssl.git --branch OpenSSL_1_1_1-stable --depth 1 openssl-1.1.1
# Set up proper MSYS2 environment
export MSYS=winsymlinks:nativestrict
export MSYS2_PATH_TYPE=strict
export LANG=en_US.UTF-8
export PATH="/usr/bin:/mingw64/bin:$PATH"
export PATH="/c/TDM-GCC-64/bin:$PATH"
export MSYSTEM=${{ matrix.msystem }}
cd openssl-1.1.1
if [[ ${{ matrix.arch }} == "x86" ]]; then
/usr/bin/perl Configure mingw --prefix=$(cygpath -u "$GITHUB_WORKSPACE")/OpenSSL-TDM-${{ matrix.arch }} --openssldir=$(cygpath -u "$GITHUB_WORKSPACE")/OpenSSL-TDM-32 no-tests no-sse2 no-asm no-threads -DOPENSSL_DEV_NO_ATOMICS -mno-mmx -mno-sse -mno-sse2 -march=i686 -mtune=generic -Os -s -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-stack-protector
else
/usr/bin/perl Configure mingw64 --prefix=$(cygpath -u "$GITHUB_WORKSPACE")/OpenSSL-TDM-${{ matrix.arch }} --openssldir=$(cygpath -u "$GITHUB_WORKSPACE")/OpenSSL-TDM-64 no-tests no-asm -DOPENSSL_DEV_NO_ATOMICS -mno-mmx -Os -s -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-stack-protector
fi
mingw32-make -j
mingw32-make install_sw
cd ..
- name: Save OpenSSL 1.1.1
if: steps.cache-openssl.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/OpenSSL-TDM-${{ matrix.arch }}
key: openssl-1.1.1-${{ matrix.arch }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Set OpenSSL Environment
shell: pwsh
run: |
echo "OPENSSL_ROOT=$env:GITHUB_WORKSPACE/OpenSSL-TDM-${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "OPENSSL_LIBDIR=lib" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "CMAKE_FLAGS=${{ matrix.cmake_flag }}" | Out-File -FilePath $env:GITHUB_ENV -Append
uses: actions/checkout@v7
- name: Configure UMSKT
shell: pwsh
run: |
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
$OPENSSL_ROOT = "$env:OPENSSL_ROOT"
$OPENSSL_LIB = "$OPENSSL_ROOT/$env:OPENSSL_LIBDIR"
$OPENSSL_INC = "$OPENSSL_ROOT/include"
cmake -G "MinGW Makefiles" `
-DCMAKE_C_COMPILER="gcc" `
-DCMAKE_CXX_COMPILER="g++" `
-DOPENSSL_ROOT_DIR="$OPENSSL_ROOT" `
-DOPENSSL_INCLUDE_DIR="$OPENSSL_INC" `
-DOPENSSL_CRYPTO_LIBRARY="$OPENSSL_LIB/libcrypto.a" `
-DOPENSSL_SSL_LIBRARY="$OPENSSL_LIB/libssl.a" `
-DCMAKE_C_FLAGS="$env:CMAKE_FLAGS" `
-DCMAKE_CXX_FLAGS="$env:CMAKE_FLAGS" `
-DCMAKE_C_FLAGS="${{ matrix.cmake_flag }}" `
-DCMAKE_CXX_FLAGS="${{ matrix.cmake_flag }}" `
-DCMAKE_POLICY_VERSION_MINIMUM="3.5" `
.
@@ -150,92 +82,38 @@ jobs:
mingw32-make
- name: Run tests
timeout-minutes: 2
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference = $false
Write-Host Test 1 - generating key
.\umskt.exe -b 2C -c 365 -s 069420 -v
Write-Host Test 2 - generatng confid
.\umskt.exe -i 253286028742154311079061239762245184619981623171292574
$keyRaw = & .\umskt.exe -b 2C -c 365 -s 069420 2>&1 | Out-String
if ($LASTEXITCODE -ne 0) {
Write-Host "key generation exited ${LASTEXITCODE}: $keyRaw"
exit 1
}
$key = $keyRaw.Trim()
if ($key -notmatch '^[BCDFGHJKMPQRTVWXY2346789-]{29}$') {
Write-Host "key generation produced no key on stdout: [$key]"
exit 1
}
Write-Host Test 2 - validating that key
.\umskt.exe -b 2C -V $key
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host Test 3 - confirmation ID
$cidRaw = & .\umskt.exe -i 253286028742154311079061239762245184619981623171292574 2>&1 | Out-String
if ($LASTEXITCODE -ne 0) {
Write-Host "confirmation ID exited ${LASTEXITCODE}: $cidRaw"
exit 1
}
$cid = $cidRaw.Trim()
if ($cid -ne '020052-539422-707952-510766-409626-387731-998883') {
Write-Host "confirmation ID mismatch: [$cid]"
exit 1
}
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
uses: actions/upload-artifact@v7
with:
name: UMSKT-WinNT-${{ matrix.arch }}
path: umskt.exe
compress:
needs: build
if: success()
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- arch: x86
- arch: x64
steps:
- name: Setup TDM-GCC
run: |
Write-Host Downloading TDM-GCC v10.3.0...
Invoke-WebRequest -Uri 'https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe' -OutFile 'C:\Windows\temp\TDM-GCC-64.exe'
Write-Host Creating directory...
New-Item -ItemType Directory -Path 'C:\TDM-GCC-64'
Write-Host Copying files [Set 1/3]...
Start-Process '7z' -ArgumentList 'e C:\Windows\temp\TDM-GCC-64.exe -oC:\TDM-GCC-64 -y' -Wait
Write-Host Copying files [Set 2/3]...
Start-Process '7z' -ArgumentList 'e C:\TDM-GCC-64\*.tar.xz -oC:\TDM-GCC-64 -y' -Wait
Write-Host Copying files [Set 3/3]...
Start-Process '7z' -ArgumentList 'x C:\TDM-GCC-64\*.tar -oC:\TDM-GCC-64 -y' -Wait
Write-Host Adding environment variables...
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
- name: Setup UPX
run: |
Invoke-WebRequest -Uri 'https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-win64.zip' -OutFile 'C:\Windows\temp\upx.zip'
Write-Host Creating directory...
New-Item -ItemType Directory -Path 'C:\UPX'
Write-Host Copying files...
Expand-Archive -Path 'C:\Windows\temp\upx.zip' -DestinationPath 'C:\UPX'
Write-Host Adding environment variables...
$env:PATH = 'C:\UPX\upx-5.0.2-win64;' + $env:PATH
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
- name: Download ${{matrix.arch}} artifact
uses: actions/download-artifact@v4
with:
name: UMSKT-WinNT-${{ matrix.arch }}
path: .
- name: Compress binaries
shell: pwsh
run: |
# Strip symbols
strip .\umskt.exe
# Remove resources
llvm-objcopy --remove-section .rsrc umskt.exe umskt_comp.exe
# Compress with UPX
& "C:\UPX\upx-5.0.2-win64\upx.exe" --best --ultra-brute .\umskt_comp.exe
# Replace original EXE
Remove-Item .\umskt.exe
Rename-Item -Path .\umskt_comp.exe -NewName umskt.exe
- name: Run tests
shell: pwsh
run: |
Write-Host Test 1 - generating key `(BINK1998`)
.\umskt.exe -b 2C -c 365 -s 069420,999999 -v
Write-Host Test 2 - generating key `(BINK2002`)
.\umskt.exe -b 5A -c 640 -s 069420,999999 -v
Write-Host Test 3 - generatng confid
.\umskt.exe -i 253286028742154311079061239762245184619981623171292574
- name: Upload build artifact
uses: actions/upload-artifact@v4.6.2
with:
name: UMSKT-WinNT-${{ matrix.arch }}-Compressed
path: umskt.exe
path: umskt.exe