port bulb changes #19
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
name: vpinball | |
on: | |
push: | |
env: | |
VERSION_START_SHA: ea558e7417f6f06fe567d34f0e33792a141b8e64 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
version: | |
name: Version | |
runs-on: ubuntu-latest | |
outputs: | |
version_short: ${{ steps.version.outputs.version_short }} | |
revision: ${{ steps.version.outputs.revision }} | |
sha7: ${{ steps.version.outputs.sha7 }} | |
tag: ${{ steps.version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: version | |
run: | | |
VERSION_MAJOR=$(grep -Eo "VP_VERSION_MAJOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | |
VERSION_MINOR=$(grep -Eo "VP_VERSION_MINOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | |
VERSION_REV=$(grep -Eo "VP_VERSION_REV\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | |
VERSION_SHORT="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}" | |
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count) | |
SHA7="${GITHUB_SHA::7}" | |
TAG="${VERSION_SHORT}-${REVISION}-${SHA7}" | |
echo "version_short=${VERSION_SHORT}" >> $GITHUB_OUTPUT | |
echo "revision=${REVISION}" >> $GITHUB_OUTPUT | |
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT | |
echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
dxsdk: | |
name: DirectX SDK | |
runs-on: windows-latest | |
steps: | |
- id: cache | |
uses: actions/cache@v4 | |
with: | |
path: DXSDK | |
key: cache-dxsdk | |
- name: Create Cache | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
curl -sL https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe | |
7z x DXSDK_Jun10.exe DXSDK/Include -otmp | |
7z x DXSDK_Jun10.exe DXSDK/Lib -otmp | |
mv tmp/DXSDK DXSDK | |
rm -fR DXSDK_Jun10.exe tmp | |
ls -Ra DXSDK | |
build: | |
name: Build VPinballX-${{ matrix.config }}-${{ matrix.platform }} | |
runs-on: windows-2019 | |
needs: [ version, dxsdk ] | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [win-x64, win-x86] | |
config: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: DXSDK | |
key: cache-dxsdk | |
- run: | | |
perl -i -pe"s/0/${{ needs.version.outputs.revision }}/g" git_version.h | |
perl -i -pe"s/unknown/${{ needs.version.outputs.sha7 }}/g" git_version.h | |
- name: Build | |
run: | | |
export DXSDK_DIR="${GITHUB_WORKSPACE}/DXSDK" | |
cp cmake/CMakeLists_${{ matrix.platform}}.txt CMakeLists.txt | |
# cmake can't find fxc.exe so copy one into the a directory in the path | |
cp "/c/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/fxc.exe" /mingw64/bin | |
if [[ "${{ matrix.platform }}" == "win-x64" ]]; then | |
cmake -T v141_xp -G "Visual Studio 16 2019" -A x64 -B build | |
else | |
cmake -T v141_xp -G "Visual Studio 16 2019" -A Win32 -B build | |
fi | |
cmake --build build --config ${{ matrix.config }} | |
- run: | | |
mkdir tmp | |
if [[ "${{ matrix.platform }}" == "win-x64" ]]; then | |
cp build/${{ matrix.config }}/VPinballX64.exe tmp | |
else | |
cp build/${{ matrix.config }}/VPinballX.exe tmp | |
fi | |
cp build/${{ matrix.config }}/*.dll tmp | |
cp -r build/${{ matrix.config }}/assets tmp | |
cp -r build/${{ matrix.config }}/scripts tmp | |
cp -r build/${{ matrix.config }}/tables tmp | |
cp -r build/${{ matrix.config }}/docs tmp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: VPinballX-${{ needs.version.outputs.tag }}-${{ matrix.config }}-${{ matrix.platform }} | |
path: tmp | |
build-gl: | |
name: Build VPinballX_GL-${{ matrix.config }}-${{ matrix.platform }} | |
runs-on: windows-2022 | |
needs: [ version, dxsdk ] | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [win-x64, win-x86] | |
config: [Release, Debug] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: DXSDK | |
key: cache-dxsdk | |
- run: | | |
perl -i -pe"s/0/${{ needs.version.outputs.revision }}/g" git_version.h | |
perl -i -pe"s/unknown/${{ needs.version.outputs.sha7 }}/g" git_version.h | |
- name: Build | |
run: | | |
export DXSDK_DIR="${GITHUB_WORKSPACE}/DXSDK" | |
cp cmake/CMakeLists_gl-${{ matrix.platform}}.txt CMakeLists.txt | |
if [[ "${{ matrix.platform }}" == "win-x64" ]]; then | |
cmake -G "Visual Studio 17 2022" -A x64 -B build | |
else | |
cmake -G "Visual Studio 17 2022" -A Win32 -B build | |
fi | |
cmake --build build --config ${{ matrix.config }} | |
- run: | | |
mkdir tmp | |
if [[ "${{ matrix.platform }}" == "win-x64" ]]; then | |
cp build/${{ matrix.config }}/VPinballX_GL64.exe tmp | |
else | |
cp build/${{ matrix.config }}/VPinballX_GL.exe tmp | |
fi | |
cp build/${{ matrix.config }}/*.dll tmp | |
cp -r build/${{ matrix.config }}/assets tmp | |
cp -r build/${{ matrix.config }}/shader${{ needs.version.outputs.version_short }} tmp | |
cp -r build/${{ matrix.config }}/scripts tmp | |
cp -r build/${{ matrix.config }}/tables tmp | |
cp -r build/${{ matrix.config }}/docs tmp | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: VPinballX_GL-${{ needs.version.outputs.tag }}-${{ matrix.config }}-${{ matrix.platform }} | |
path: tmp |