Files
xpmgr/.github/workflows/windows.yml
T
2026-10-24 22:39:55 -04:00

76 lines
2.5 KiB
YAML

name: C/C++ CI (Windows)
on:
push:
branches: [ "*" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Source Tree
uses: actions/[email protected]
- name: Cache TDM-GCC
id: cache-gcc
uses: actions/cache/restore@v4
with:
path: |
C:\TDM-GCC-64
key: TDM-GCC-10.3.0
- name: Setup TDM-GCC
if: steps.cache-gcc.outputs.cache-hit != 'true'
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
- name: Save TDM-GCC
uses: actions/cache/save@v4
if: steps.cache-gcc.outputs.cache-hit != 'true'
with:
path: |
C:\TDM-GCC-64
key: TDM-GCC-10.3.0
- name: Setup folder directories
run: |
Write-Host Adding environment variables...
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
mkdir build
mkdir build\x86
mkdir build\x64
- name: Build xpmgr
run: |
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_CXX_COMPILER=C:/TDM-GCC-64/bin/g++.exe
cmake --build build --config Debug
- name: Strip binaries
run: |
$env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
strip .\build\xpmgr_x86.exe
strip .\build\xpmgr_x64.exe
- name: Upload build artifact (x86)
uses: actions/[email protected]
with:
name: xpmgr (x86)
path: .\build\xpmgr_x86.exe
- name: Upload build artifact (x64)
uses: actions/[email protected]
with:
name: xpmgr (x64)
path: .\build\xpmgr_x64.exe