2021-05-09 06:48:20 +02:00
|
|
|
name: 'sfall'
|
|
|
|
|
description: 'Builds sfall binaries'
|
|
|
|
|
author: '@wipe2238'
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
|
#
|
|
|
|
|
# Example:
|
|
|
|
|
#
|
|
|
|
|
# - name: Build sfall
|
|
|
|
|
# id: sfall
|
2024-06-16 15:52:48 +02:00
|
|
|
# uses: sfall-team/sfall@master
|
2021-05-09 06:48:20 +02:00
|
|
|
#
|
|
|
|
|
# - name: Copy sfall to mod directory
|
|
|
|
|
# run: copy "${{ steps.sfall.outputs.release-xp }}" "my/mod/directory/ddraw.dll"
|
|
|
|
|
#
|
|
|
|
|
###
|
|
|
|
|
|
|
|
|
|
# While both inputs are marked as required, users needs to set only one of them (at minimum) to 'true' for action to work
|
|
|
|
|
inputs:
|
|
|
|
|
|
|
|
|
|
release-xp:
|
|
|
|
|
description: 'Set to true to enable building with ReleaseXP configuration'
|
2024-06-16 15:52:48 +02:00
|
|
|
required: false
|
|
|
|
|
default: true
|
2021-05-09 06:48:20 +02:00
|
|
|
|
|
|
|
|
dev-xp:
|
|
|
|
|
description: 'Set to true to enable building with DevXP configuration'
|
2024-06-16 15:52:48 +02:00
|
|
|
required: false
|
|
|
|
|
default: false
|
2021-05-09 06:48:20 +02:00
|
|
|
|
|
|
|
|
# Outputs are always using Windows directory separator (`\`)
|
|
|
|
|
outputs:
|
|
|
|
|
|
|
|
|
|
release-xp:
|
|
|
|
|
description: 'Full path to ddraw.dll built with ReleaseXP configuration'
|
|
|
|
|
value: ${{ steps.build-release-xp.outputs.ddraw-dll }}
|
|
|
|
|
|
|
|
|
|
dev-xp:
|
|
|
|
|
description: 'Full path to ddraw.dll built with DevXP configuration'
|
|
|
|
|
value: ${{ steps.build-dev-xp.outputs.ddraw-dll }}
|
|
|
|
|
dev-xp-pdb:
|
|
|
|
|
description: 'Full path to ddraw.pdb built with DevXP configuration'
|
|
|
|
|
value: ${{ steps.build-dev-xp.outputs.ddraw-pdb }}
|
|
|
|
|
|
|
|
|
|
runs:
|
|
|
|
|
using: 'composite'
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
|
|
# Quick check for things which should never happen
|
|
|
|
|
- name: Sanity checks
|
|
|
|
|
run: |
|
2024-06-16 15:52:48 +02:00
|
|
|
if [[ "$RUNNER_OS" != "Windows" ]]; then
|
2021-05-09 06:48:20 +02:00
|
|
|
echo "[ERROR] This action can only be used on Windows"
|
|
|
|
|
exit 1
|
|
|
|
|
elif [[ "${{ inputs.release-xp }}" != "true" ]] && [[ "${{ inputs.dev-xp }}" != "true" ]]; then
|
|
|
|
|
echo "[ERROR] At least one of following inputs must be set to 'true' -- 'release-xp', 'dev-xp'"
|
|
|
|
|
exit 1
|
|
|
|
|
#
|
|
|
|
|
elif [[ ! -d "$(cygpath --unix "$GITHUB_ACTION_PATH/sfall/")" ]]; then
|
|
|
|
|
echo "[ERROR] Solution directory not found -- 'sfall\\'"
|
|
|
|
|
exit 1
|
|
|
|
|
elif [[ ! -f "$(cygpath --unix "$GITHUB_ACTION_PATH/sfall/ddraw.sln")" ]]; then
|
|
|
|
|
echo "[ERROR] Solution file not found -- 'sfall\\ddraw.sln'"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
#
|
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
|
|
# DXSDK directory must be prepared only once, in case action is used N times
|
|
|
|
|
# Using `.lib` suffix to make sure directory is ignored by git in exotic scenarios
|
2024-06-16 15:52:48 +02:00
|
|
|
# Using $GITHUB_OUTPUT to make sure workflow environment remains unchanged
|
2021-05-09 06:48:20 +02:00
|
|
|
- name: Prepare DXSDK directory
|
|
|
|
|
id: dxsdk
|
|
|
|
|
run: |
|
|
|
|
|
DXSDK_DIR="$GITHUB_ACTION_PATH/sfall/DXSDK.lib"
|
|
|
|
|
if [[ ! -d "$DXSDK_DIR" ]]; then
|
|
|
|
|
echo "::group::Prepare DXSDK directory"
|
|
|
|
|
#
|
|
|
|
|
git clone --quiet https://github.com/NovaRain/DXSDK_Collection.git "$DXSDK_DIR"
|
|
|
|
|
cp "$DXSDK_DIR/DXSDK_Aug2007/Lib/x86/dinput.lib" "$DXSDK_DIR/DXSDK_Jun2010/Lib/x86/"
|
2021-12-19 09:06:20 +08:00
|
|
|
cp "$DXSDK_DIR/DXSDK_Feb2010/Lib/x86/ddraw.lib" "$DXSDK_DIR/DXSDK_Jun2010/Lib/x86/"
|
2021-05-09 06:48:20 +02:00
|
|
|
#
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
fi
|
2023-04-14 14:04:41 +08:00
|
|
|
echo "dir=$(cygpath --windows "$DXSDK_DIR/DXSDK_Jun2010/")" >> $GITHUB_OUTPUT
|
2021-05-09 06:48:20 +02:00
|
|
|
shell: bash
|
|
|
|
|
|
2025-07-07 11:11:22 +08:00
|
|
|
# Install VS 2015 C++ build tools and WinXP Support components via Chocolatey
|
|
|
|
|
- name: Prepare VS 2015 C++ build tools
|
|
|
|
|
id: vs2015_tools
|
|
|
|
|
run: |
|
|
|
|
|
echo "::group::Prepare VS 2015 C++ build tools"
|
|
|
|
|
|
|
|
|
|
choco install visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.WinXP --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --passive"
|
|
|
|
|
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
shell: bash
|
|
|
|
|
|
2021-05-09 06:48:20 +02:00
|
|
|
# MSBuild is not in PATH on Windows machines
|
2024-06-16 15:52:48 +02:00
|
|
|
# Using $GITHUB_OUTPUT to make sure workflow environment remains unchanged
|
2021-05-09 06:48:20 +02:00
|
|
|
- name: Prepare MSBuild
|
|
|
|
|
id: msbuild
|
|
|
|
|
run: |
|
|
|
|
|
echo "::group::Prepare MSBuild"
|
|
|
|
|
|
|
|
|
|
MSBUILD_EXE="$("/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild/**/Bin/MSBuild.exe)"
|
2023-04-14 14:04:41 +08:00
|
|
|
echo "exe=$MSBUILD_EXE" >> $GITHUB_OUTPUT
|
2021-05-09 06:48:20 +02:00
|
|
|
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
|
|
- name: Build ReleaseXP
|
|
|
|
|
id: build-release-xp
|
|
|
|
|
run: |
|
|
|
|
|
if [[ "${{ inputs.release-xp }}" == "true" ]]; then
|
|
|
|
|
echo ::group::Build ReleaseXP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
"${{ steps.msbuild.outputs.exe }}" "$GITHUB_ACTION_PATH/sfall/ddraw.sln" -p:Configuration=ReleaseXP -p:Platform=Win32 -p:PlatformToolset=v140_xp
|
|
|
|
|
#
|
2023-04-14 14:04:41 +08:00
|
|
|
echo "ddraw-dll=$(cygpath --windows "$GITHUB_ACTION_PATH/sfall/ReleaseXP/ddraw.dll")" >> $GITHUB_OUTPUT
|
2021-05-09 06:48:20 +02:00
|
|
|
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
fi
|
|
|
|
|
env:
|
|
|
|
|
DXSDK_DIR: ${{ steps.dxsdk.outputs.dir }}
|
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
|
|
- name: Build DevXP
|
|
|
|
|
id: build-dev-xp
|
|
|
|
|
run: |
|
|
|
|
|
:
|
|
|
|
|
if [[ "${{ inputs.dev-xp }}" == "true" ]]; then
|
|
|
|
|
echo "::group::Build DevXP"
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
"${{ steps.msbuild.outputs.exe }}" "$GITHUB_ACTION_PATH/sfall/ddraw.sln" -p:Configuration=DevXP -p:Platform=Win32 -p:PlatformToolset=v140_xp
|
|
|
|
|
#
|
2023-04-14 14:04:41 +08:00
|
|
|
echo "ddraw-dll=$(cygpath --windows "$GITHUB_ACTION_PATH/sfall/DevXP/ddraw.dll")" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "ddraw-pdb=$(cygpath --windows "$GITHUB_ACTION_PATH/sfall/DevXP/ddraw.pdb")" >> $GITHUB_OUTPUT
|
2021-05-09 06:48:20 +02:00
|
|
|
|
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
fi
|
|
|
|
|
env:
|
|
|
|
|
DXSDK_DIR: ${{ steps.dxsdk.outputs.dir }}
|
|
|
|
|
shell: bash
|