Modularise Windows arch on CI
This commit is contained in:
parent
6c9f1c6d54
commit
8483f85397
81
.github/workflows/build.yml
vendored
81
.github/workflows/build.yml
vendored
|
@ -12,6 +12,7 @@ defaults:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
|
WINDOWS_ARCH: x86
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Do a plain build, like we would expect a user to do it on their end.
|
# Do a plain build, like we would expect a user to do it on their end.
|
||||||
|
@ -34,9 +35,37 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Set Windows arch identifiers
|
||||||
|
id: windows-identify
|
||||||
|
if: ${{ matrix.config.compiler == 'msvc' || matrix.config.compiler == 'mingw' }}
|
||||||
|
run: |
|
||||||
|
vswhere_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
msvc_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
mingw_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
|
||||||
|
if [ '${{ env.WINDOWS_ARCH }}' == 'x86' ]; then
|
||||||
|
msvc_target="Win32"
|
||||||
|
elif [ '${{ env.WINDOWS_ARCH }}' == 'x86_64' ]; then
|
||||||
|
vswhere_target="amd64"
|
||||||
|
msvc_target="x64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
||||||
|
echo "vswhere target: ${vswhere_target}"
|
||||||
|
echo "MSVC target: ${msvc_target}"
|
||||||
|
else
|
||||||
|
echo "MinGW cross target: ${mingw_target}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "::set-output name=vswhere-target::${vswhere_target}"
|
||||||
|
echo "::set-output name=msvc-target::${msvc_target}"
|
||||||
|
echo "::set-output name=mingw-target::${mingw_target}"
|
||||||
|
|
||||||
- name: Setup Toolchain [Windows MSVC]
|
- name: Setup Toolchain [Windows MSVC]
|
||||||
if: ${{ matrix.config.compiler == 'msvc' }}
|
if: ${{ matrix.config.compiler == 'msvc' }}
|
||||||
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
||||||
|
with:
|
||||||
|
arch: ${{ steps.windows-identify.outputs.vswhere-target }}
|
||||||
|
|
||||||
- name: Setup Toolchain [Windows MinGW]
|
- name: Setup Toolchain [Windows MinGW]
|
||||||
if: ${{ matrix.config.compiler == 'mingw' }}
|
if: ${{ matrix.config.compiler == 'mingw' }}
|
||||||
|
@ -73,10 +102,12 @@ jobs:
|
||||||
export USE_WAE=ON
|
export USE_WAE=ON
|
||||||
export CMAKE_EXTRA_ARGS=()
|
export CMAKE_EXTRA_ARGS=()
|
||||||
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
||||||
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_GENERATOR_PLATFORM=${{ steps.windows-identify.outputs.msvc-target }}')
|
||||||
|
|
||||||
# FIXME We don't want all the MSVC warnings to cause errors yet
|
# FIXME We don't want all the MSVC warnings to cause errors yet
|
||||||
export USE_WAE=OFF
|
export USE_WAE=OFF
|
||||||
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-x86.cmake')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake \
|
cmake \
|
||||||
|
@ -122,9 +153,37 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Set Windows arch identifiers
|
||||||
|
id: windows-identify
|
||||||
|
if: ${{ matrix.config.compiler == 'msvc' || matrix.config.compiler == 'mingw' }}
|
||||||
|
run: |
|
||||||
|
vswhere_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
msvc_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
mingw_target="${{ env.WINDOWS_ARCH }}"
|
||||||
|
|
||||||
|
if [ '${{ env.WINDOWS_ARCH }}' == 'x86' ]; then
|
||||||
|
msvc_target="Win32"
|
||||||
|
elif [ '${{ env.WINDOWS_ARCH }}' == 'x86_64' ]; then
|
||||||
|
vswhere_target="amd64"
|
||||||
|
msvc_target="x64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
||||||
|
echo "vswhere target: ${vswhere_target}"
|
||||||
|
echo "MSVC target: ${msvc_target}"
|
||||||
|
else
|
||||||
|
echo "MinGW cross target: ${mingw_target}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "::set-output name=vswhere-target::${vswhere_target}"
|
||||||
|
echo "::set-output name=msvc-target::${msvc_target}"
|
||||||
|
echo "::set-output name=mingw-target::${mingw_target}"
|
||||||
|
|
||||||
- name: Setup Toolchain [Windows MSVC]
|
- name: Setup Toolchain [Windows MSVC]
|
||||||
if: ${{ matrix.config.compiler == 'msvc' }}
|
if: ${{ matrix.config.compiler == 'msvc' }}
|
||||||
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
||||||
|
with:
|
||||||
|
arch: ${{ steps.windows-identify.outputs.vswhere-target }}
|
||||||
|
|
||||||
- name: Setup Toolchain [Windows MinGW]
|
- name: Setup Toolchain [Windows MinGW]
|
||||||
if: ${{ matrix.config.compiler == 'mingw' }}
|
if: ${{ matrix.config.compiler == 'mingw' }}
|
||||||
|
@ -159,8 +218,8 @@ jobs:
|
||||||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
chmod +x appimagetool-x86_64.AppImage
|
chmod +x appimagetool-x86_64.AppImage
|
||||||
|
|
||||||
- name: Set package identity
|
- name: Set package identifier
|
||||||
id: package-identity
|
id: package-identify
|
||||||
run: |
|
run: |
|
||||||
package_name="furnace-${GITHUB_SHA}"
|
package_name="furnace-${GITHUB_SHA}"
|
||||||
package_ext=""
|
package_ext=""
|
||||||
|
@ -180,7 +239,7 @@ jobs:
|
||||||
package_ext=".AppImage"
|
package_ext=".AppImage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Package identity: ${package_name}"
|
echo "Package identifier: ${package_name}"
|
||||||
echo "Package file: ${package_name}${package_ext}"
|
echo "Package file: ${package_name}${package_ext}"
|
||||||
|
|
||||||
echo "::set-output name=id::${package_name}"
|
echo "::set-output name=id::${package_name}"
|
||||||
|
@ -191,6 +250,8 @@ jobs:
|
||||||
export USE_WAE=ON
|
export USE_WAE=ON
|
||||||
export CMAKE_EXTRA_ARGS=()
|
export CMAKE_EXTRA_ARGS=()
|
||||||
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
||||||
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_GENERATOR_PLATFORM=${{ steps.windows-identify.outputs.msvc-target }}')
|
||||||
|
|
||||||
# FIXME We don't want all the MSVC warnings to cause errors yet
|
# FIXME We don't want all the MSVC warnings to cause errors yet
|
||||||
export USE_WAE=OFF
|
export USE_WAE=OFF
|
||||||
|
|
||||||
|
@ -209,7 +270,7 @@ jobs:
|
||||||
env EMAIL=root@localhost git am ../SDL-Fix-MSVC-static-runtime-linking.patch
|
env EMAIL=root@localhost git am ../SDL-Fix-MSVC-static-runtime-linking.patch
|
||||||
popd
|
popd
|
||||||
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-x86.cmake')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
|
||||||
elif [ '${{ runner.os }}' == 'macOS' ]; then
|
elif [ '${{ runner.os }}' == 'macOS' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="10.9"')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="10.9"')
|
||||||
fi
|
fi
|
||||||
|
@ -247,7 +308,7 @@ jobs:
|
||||||
cp -v ../README.md README.txt
|
cp -v ../README.md README.txt
|
||||||
cp -vr ../{papers,demos} ../${binPath}/furnace.exe ./
|
cp -vr ../{papers,demos} ../${binPath}/furnace.exe ./
|
||||||
|
|
||||||
7z a -tzip ../${{ steps.package-identity.outputs.filename }} *
|
7z a -tzip ../${{ steps.package-identify.outputs.filename }} *
|
||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Package [macOS]
|
- name: Package [macOS]
|
||||||
|
@ -255,7 +316,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pushd build
|
pushd build
|
||||||
cpack
|
cpack
|
||||||
mv Furnace-*-Darwin.dmg ../${{ steps.package-identity.outputs.filename }}
|
mv Furnace-*-Darwin.dmg ../${{ steps.package-identify.outputs.filename }}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Package [Ubuntu]
|
- name: Package [Ubuntu]
|
||||||
|
@ -277,11 +338,11 @@ jobs:
|
||||||
popd
|
popd
|
||||||
|
|
||||||
../appimagetool-x86_64.AppImage furnace.AppDir
|
../appimagetool-x86_64.AppImage furnace.AppDir
|
||||||
mv Furnace-*.AppImage ../${{ steps.package-identity.outputs.filename }}
|
mv Furnace-*.AppImage ../${{ steps.package-identify.outputs.filename }}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package-identity.outputs.id }}
|
name: ${{ steps.package-identify.outputs.id }}
|
||||||
path: ${{ steps.package-identity.outputs.filename }}
|
path: ${{ steps.package-identify.outputs.filename }}
|
||||||
|
|
Loading…
Reference in a new issue