This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DO NOT TEST YOURSELF | |
# MIGHT ONLY WORK IN A VERY CONTROLLED ENVIRONMENT AS OF NOW | |
# only running this in a very small windows VM | |
name: "Build, test, bundle FastGH3" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: self-hosted | |
env: | |
#NETPACKER: ${{vars.NETPACKER}} # mpress or DotNetCompressor | |
#cygenv: | |
# ${{vars.CYGENV == 'CYGWIN' && 'cygwin' || 'msys2'}} | |
# # value can be either CYGWIN or MSYS | |
node: ${{vars.BUN == 'true' && 'bun' || 'nodejs'}} | |
# use Bun if true, Node.js if false | |
BUILD: ${{vars.BUILD}} # bitflags to indicate which types of builds to create | |
#NSIS: 'C:\Program Files (x86)\NSIS\makensis.exe' | |
#CYGWIN: winsymlinks:nativestrict | |
environment: Test env | |
if: github.actor == 'donnaken15' | |
steps: | |
- | |
name: Update system environment | |
run: | | |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | |
- | |
name: Install Git | |
run: | | |
where.exe git /q; if (-not $?) { | |
choco install git -y | |
} | |
"C:\Program Files\Git\bin\" | Out-File -FilePath $env:GITHUB_PATH -Append | |
"C:\Program Files\Git\usr\" | Out-File -FilePath $env:GITHUB_PATH -Append | |
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\" | Out-File -FilePath $env:GITHUB_PATH -Append | |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | |
pushd "C:\Program Files\Git" | |
compact /c /f /s /a /i /exe:lzx *.exe *.dll *.txt *.pm *. | Select-Object -Last 3 | |
popd | |
- | |
name: Install Node.js or Bun | |
run: | | |
where.exe $env:node /q; if (-not $?) { | |
choco install $env:node -y --no-progress | |
} else { "Node environment is already installed" } | |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | |
- | |
name: Install UPX, NSIS, 7Zip, Resource Hacker # make optionally installable if user decides so | |
run: | | |
choco install upx nsis 7zip resourcehacker.portable -y --no-progress | |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | |
- | |
name: Install DotNetCompressor | |
env: | |
condition: ${{vars.NETPACKERS}} | |
if: ${{env.condition == 'DotNetCompressor'}} | |
run: | | |
iwr -Uri "https://github.com/donnaken15/DotNetCompressor/releases/latest/download/NetCompressor.exe" -OutFile "C:\Windows\DotNetCompressor.exe" | |
- | |
name: Install mpress | |
env: | |
condition: ${{vars.NETPACKERS}} | |
if: ${{env.condition != 'DotNetCompressor'}} | |
#if: ${{vars.NETPACKER == 'mpress'}} | |
run: | | |
choco install mpress -y --no-progress | |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | |
- | |
name: Install stripreloc | |
env: | |
condition: ${{vars.NORELOC}} | |
if: ${{env.condition == 'true'}} | |
run: | | |
iwr -Uri "https://jrsoftware.org/download.php/striprlc.zip" -OutFile "striprlc.zip" | |
Expand-Archive -Path "striprlc.zip" -DestinationPath "C:\Windows" -Force | |
del "striprlc.zip" | |
- | |
name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
# manual checkout all repositories: * | |
# for manual testing: | |
# set "PATH=%PATH%;C:\Program Files\git\bin;C:\Program Files\git\usr\bin" | |
# & "C:\Program Files\Git\bin\git" submodule update --init --recursive --remote | |
# & "C:\Program Files\Git\bin\git" pull --recurse-submodules | |
- | |
name: Set up MSBuild, Visual C# and C++ | |
env: | |
GH3PLUS: ${{vars.GH3PLUS}} # build GH3+ plugins | |
condition: ${{vars.SHARPDEV}} | |
if: ${{env.condition != null}} | |
#uses: microsoft/setup-msbuild@v1 # NOT WORKING!! | |
#with: | |
# vs-version: 'latest' | |
run: | | |
.\.github\workflows\visualDeps.ps1 | |
#choco install microsoft-build-tools netfx-4.6.2-devpack visualcpp-build-tools -y | |
# NOPE: visualcpp-build-tools | |
# NOPE: VisualCppBuildTools | |
# vcbuildtools | |
# microsoft-visual-cpp-build-tools | |
#what a freaking useless "utility" | |
# https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe | |
# https://download.microsoft.com/download/5/A/8/5A8B8314-CA70-4225-9AF0-9E957C9771F7/vs_BuildTools.exe | |
# https://aka.ms/vs/17/release/vs_BuildTools.exe | |
# vs_BuildTools.exe --add Microsoft.VisualStudio.Component.VC.140 | |
- | |
name: Build project | |
env: | |
conf: ${{vars.GH3PLUS == true && 'Release' || 'NoVC++'}} | |
STUPID: true # STRIPRELOC BREAKS EXE ON SELF HOSTED RUNNER SOMEHOW | |
GH3PLUS: ${{vars.GH3PLUS}} | |
#NORELOC: ${{vars.NORELOC}} # BREAKS EXE ON VM | |
RCASSETS: ${{vars.RCASSETS}} # recompile assets, NOT WORKING RIGHT NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
VCTargetsPath: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140 | |
# * | |
run: | | |
& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" SOURCE\FastGH3.sln /p:Configuration=$env:CONF /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v140 /p:AdditionalIncludePaths="$env:INCLUDE" /t:Rebuild | |
if ($env:RCASSETS) { | |
cmd.exe /c "SOURCE\build-assets.bat" | |
} | |
# ERRORS AT 'DO' IN FOR BLOCK IN CMD WTF | |
test: | |
runs-on: self-hosted | |
env: | |
EXTRACFG: ${{vars.EXTRACFG}} # custom INI properties | |
environment: Playtest env | |
steps: | |
#- | |
# name: Checkout repository | |
# uses: actions/checkout@v2 | |
# with: | |
# submodules: recursive | |
# directx 9 only | |
# https://archive.org/download/directx_9c/directx_9c_redist.exe | |
# http://software.oldversion.com/download.php?f=YTo1OntzOjQ6InRpbWUiO2k6MTcyNTg5MzYyOTtzOjI6ImlkIjtpOjE4NTU1O3M6NDoiZmlsZSI7czozNDoiZGlyZWN0eC05LTBjLWRpcmVjdHhfOWNfcmVkaXN0LmV4ZSI7czozOiJ1cmwiO3M6NDY6Imh0dHA6Ly93d3cub2xkdmVyc2lvbi5jb20vd2luZG93cy9kaXJlY3R4LTktMGMiO3M6NDoicGFzcyI7czozMjoiMmNmOGE1YzIzNTc5ZjEwYzUyM2Q4ZjI0NDFiZTZjZjAiO30%3D | |
# june 2010 https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe | |
- | |
name: Playtest songs | |
run: | | |
$DXTEMP = "C:\DXTEMP" | |
iwr -OutFile "DX9.EXE" -Uri "https://archive.org/download/directx_9c/directx_9c_redist.exe" | |
start -Wait -FilePath "DX9.EXE" -Args "/Q /T:$DXTEMP" | |
start -Wait -FilePath "$DXTEMP\DXSETUP.EXE" -Args "/silent" | |
rm "$DXTEMP" -r -force | |
cmd /c dir | |
cmd /c register.bat | |
.\.github\workflows\testSongs.ps1 | |
# TODO: write configs to test | |
# TODO: CHECK IF BUILD TOOLS ARE INSTALLED | |
# TODO: should be made more cleanly by putting songs to test in this YAML | |
# TODO: fix game | |
# TODO: get a life | |
# i hate powershell now |