Files
WindowsXPKg/.github/workflows/windows-x86-x64.yml
T
2026-10-30 17:00:36 -04:00

120 lines
4.3 KiB
YAML

# This file is a part of the UMSKT Project
#
# Copyleft (C) 2019-2023 UMSKT Contributors (et.al.)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# @FileCreated by TheTank20 on 07/08/2025
# @Maintainer Neo
name: Windows x86+64
on:
push:
branches: [ "*" ]
paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip
pull_request:
branches: [ "*" ]
paths-ignore: [ '**.md', 'doc/**', '.idea/**']
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- arch: x86
msystem: MINGW
cmake_flag: -m32
- arch: x64
msystem: MINGW64
cmake_flag: -m64
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: Checkout Source Tree
uses: actions/checkout@v7
- name: Configure UMSKT
shell: pwsh
run: |
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
cmake -G "MinGW Makefiles" `
-DCMAKE_C_COMPILER="gcc" `
-DCMAKE_CXX_COMPILER="g++" `
-DCMAKE_C_FLAGS="${{ matrix.cmake_flag }}" `
-DCMAKE_CXX_FLAGS="${{ matrix.cmake_flag }}" `
-DCMAKE_POLICY_VERSION_MINIMUM="3.5" `
.
- name: Build UMSKT
shell: pwsh
run: |
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
mingw32-make
- name: Run tests
timeout-minutes: 2
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference = $false
Write-Host Test 1 - generating key
$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@v7
with:
name: UMSKT-Windows-${{ matrix.arch }}
path: umskt.exe