Merge branch 'primary' of https://github.com/WalterBarrett/Mocha-Conq… #2
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: mingw-w64 | |
on: | |
pull_request: | |
push: | |
jobs: | |
remaster_gcc: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Git Info | |
id: gitinfo | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -qq > /dev/null | |
sudo apt-get install -qq -y mingw-w64 > /dev/null | |
- name: Configure Mocha Conquer | |
run: | | |
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/i686-mingw-w64-toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_REMASTERTD=ON -DBUILD_REMASTERRA=ON -DBUILD_VANILLATD=OFF -DBUILD_VANILLARA=OFF -DNETWORKING=OFF -B build | |
- name: Build Mocha Conquer | |
run: | | |
cmake --build build -- -j 4 | |
cp ./build/TiberianDawn.dll ./build/TiberianDawn.dbg | |
cp ./build/RedAlert.dll ./build/RedAlert.dbg | |
i686-w64-mingw32-strip --strip-all ./build/TiberianDawn.dll | |
i686-w64-mingw32-strip --strip-all ./build/RedAlert.dll | |
i686-w64-mingw32-objcopy --add-gnu-debuglink=./build/TiberianDawn.dbg ./build/TiberianDawn.dll | |
i686-w64-mingw32-objcopy --add-gnu-debuglink=./build/RedAlert.dbg ./build/RedAlert.dll | |
cp -f ./build/TiberianDawn.dll ./build/Mocha_TD/Data/ | |
cp -f ./build/RedAlert.dll ./build/Mocha_RA/Data/ | |
- name: Create archives | |
run: | | |
mkdir artifact | |
7z a artifact/mocha-conquer-remasterdll-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/TiberianDawn.dll ./build/RedAlert.dll | |
7z a artifact/mocha-conquer-remasterdll-gcc-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/TiberianDawn.dbg ./build/RedAlert.dbg | |
7z a artifact/mocha-ra-remaster-mod-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Mocha_RA | |
7z a artifact/mocha-td-remaster-mod-gcc-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/Mocha_TD | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: mocha-conquer-remaster-gcc | |
path: artifact | |
mocha_win_gcc: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
platform: [x86, amd64] | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Git Info | |
id: gitinfo | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Set variables | |
id: vars | |
run: | | |
if [ "${{ matrix.platform }}" = "x86" ] | |
then | |
echo "oal_path=Win32" >> $GITHUB_OUTPUT | |
echo "arc_path=i686" >> $GITHUB_OUTPUT | |
else | |
echo "oal_path=Win64" >> $GITHUB_OUTPUT | |
echo "arc_path=x86_64" >> $GITHUB_OUTPUT | |
fi | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -qq > /dev/null | |
sudo apt-get install -qq -y mingw-w64 imagemagick > /dev/null | |
wget -q https://www.libsdl.org/release/SDL2-devel-2.0.12-mingw.tar.gz | |
wget -q https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip | |
tar -xf SDL2-devel-2.0.12-mingw.tar.gz -C /tmp | |
unzip -qq openal-soft-1.21.0-bin.zip -d /tmp | |
mv /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/soft_oal.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll | |
- name: Configure Mocha Conquer | |
run: | | |
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/${{ steps.vars.outputs.arc_path }}-mingw-w64-toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSDL2=ON -DSDL2_ROOT_DIR=/tmp/SDL2-2.0.12 -DSDL2_INCLUDE_DIR=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/include/SDL2 -DSDL2_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/lib/libSDL2.dll.a -DSDL2_SDLMAIN_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/lib/libSDL2main.a -DSDL2_RUNTIME_LIBRARY=/tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll -DOPENAL=ON -DOPENAL_ROOT=/tmp/openal-soft-1.21.0-bin -DOPENAL_INCLUDE_DIR=/tmp/openal-soft-1.21.0-bin/include/AL -DOPENAL_LIBRARY=/tmp/openal-soft-1.21.0-bin/libs/${{ steps.vars.outputs.oal_path }}/libOpenAL32.dll.a -DOPENAL_RUNTIME_LIBRARY=/tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll -DBUILD_TOOLS=ON -DBUILD_REMASTERTD=OFF -DBUILD_REMASTERRA=OFF -DMAP_EDITORTD=ON -DMAP_EDITORRA=ON -DImageMagick_convert_EXECUTABLE=/usr/bin/convert -DImageMagick_convert_FOUND=TRUE -B build | |
- name: Build Mocha Conquer | |
run: | | |
cmake --build build -- -j 4 | |
cp ./build/mochatd.exe ./build/mochatd.dbg | |
cp ./build/mochara.exe ./build/mochara.dbg | |
cp ./build/mochamix.exe ./build/mochamix.dbg | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/mochatd.exe | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/mochara.exe | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-strip --strip-all ./build/mochamix.exe | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/mochatd.dbg ./build/mochatd.exe | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/mochara.dbg ./build/mochara.exe | |
${{ steps.vars.outputs.arc_path }}-w64-mingw32-objcopy --add-gnu-debuglink=./build/mochamix.dbg ./build/mochamix.exe | |
- name: Create archives | |
run: | | |
mkdir artifact | |
7z a artifact/mocha-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/mochatd.exe ./build/mochara.exe ./build/mochamix.exe /tmp/SDL2-2.0.12/${{ steps.vars.outputs.arc_path }}-w64-mingw32/bin/SDL2.dll /tmp/openal-soft-1.21.0-bin/bin/${{ steps.vars.outputs.oal_path }}/OpenAL32.dll | |
7z a artifact/mocha-conquer-win-gcc-${{ steps.vars.outputs.arc_path }}-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/mochatd.dbg ./build/mochara.dbg ./build/mochamix.dbg | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: mocha-conquer-win-gcc-${{ steps.vars.outputs.arc_path }} | |
path: artifact | |
- name: Upload development release | |
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/primary' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Development Build | |
tag_name: "latest" | |
prerelease: true | |
files: | | |
artifact/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload tagged release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
artifact/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |