diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1d5f28..5606e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,18 +13,18 @@ jobs: submodules: recursive - name: Install deps - run: |- + run: | sudo apt-get update && sudo apt-get install -y build-essential clang cmake xorg-dev libgl-dev\ libudev-dev libopenal-dev libvorbis-dev libflac-dev libreadline-dev libncurses-dev - name: Build - run: |- + run: | mkdir $GITHUB_WORKSPACE/_build && cd $GITHUB_WORKSPACE/_build cmake .. -DCMAKE_BUILD_TYPE=Release make -j $(nproc) - name: Copy the release to /someone/someone-${{github.sha}}/ - run: |- + run: | sudo mkdir -p /someone/someone-${{github.sha}}/ cd $GITHUB_WORKSPACE/_build/ sudo cp -r someone resources/ /someone/someone-${{github.sha}}/ @@ -43,15 +43,58 @@ jobs: submodules: recursive - name: Install MSYS2 - uses: numworks/setup-msys2@v1 + uses: eine/setup-msys2@v0 + with: + update: true + path-type: inherit - - name: Install deps - run: |- - msys2do pacman -S --noconfirm base-devel clang cmake + - name: Install dependencies + shell: msys2 {0} + run: pacman -S --noconfirm mingw-w64-x86_64-{cmake,gcc} mingw-w64-i686-{cmake,gcc} make + + - name: Build x86_64 + shell: msys2 {0} + run: | + mkdir ${GITHUB_WORKSPACE}/_build && cd ${GITHUB_WORKSPACE}/_build + cmake .. -DCMAKE_BUILD_TYPE=Release -G Unix\ Makefiles + make -j $(nproc) + + - name: Copy the x86_64 release to /d/someone/someone-${{github.sha}}-x86_64/ + shell: msys2 {0} + run: | + cd ${GITHUB_WORKSPACE}/_build + mkdir -p /d/someone-x86_64/someone-${{github.sha}}-x86_64/ + cp -r someone.exe resources\ + deps/lua/lua53.dll /mingw64/bin/{libstdc++-6.dll,libgcc_s_seh-1.dll,libwinpthread-1.dll}\ + ../deps/sfml/extlibs/bin/x64/openal32.dll /d/someone-x86_64/someone-${{github.sha}}-x86_64 - - name: Build - run: |- - msys2do mkdir $GITHUB_WORKSPACE/_build - cd $GITHUB_WORKSPACE/_build - msys2do cmake .. -DCMAKE_BUILD_TYPE=Release - msys2do make -j $(nproc) + - name: Upload the x86_64 release artifact + uses: actions/upload-artifact@v2 + with: + name: "someone-${{github.sha}}-windows-x86_64" + path: "D:\\someone-x86_64" + + - name: Build i686 + env: + MSYSTEM: MINGW32 + shell: msys2 {0} + run: | + rm -rf ${GITHUB_WORKSPACE}/_build + mkdir ${GITHUB_WORKSPACE}/_build && cd ${GITHUB_WORKSPACE}/_build + cmake .. -DCMAKE_BUILD_TYPE=Release -G Unix\ Makefiles + make -j $(nproc) + + - name: Copy the i686 release to /d/someone/someone-${{github.sha}}-i686/ + shell: msys2 {0} + run: | + cd ${GITHUB_WORKSPACE}/_build + mkdir -p /d/someone-i686/someone-${{github.sha}}-i686/ + cp -r someone.exe resources\ + deps/lua/lua53.dll /mingw32/bin/{libstdc++-6.dll,libgcc_s_dw2-1.dll,libwinpthread-1.dll}\ + ../deps/sfml/extlibs/bin/x86/openal32.dll /d/someone-i686/someone-${{github.sha}}-i686 + + - name: Upload the i686 release artifact + uses: actions/upload-artifact@v2 + with: + name: "someone-${{github.sha}}-windows-i686" + path: "D:\\someone-i686" \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0693b36..b53e290 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ if(WIN32) add_custom_command( OUTPUT ${LUAROCKS_BIN} DEPENDS lua copy-luarocks-before-build - COMMAND cmd //c "install.bat /lua ${PROJECT_BINARY_DIR}/deps/lua/ /inc ${PROJECT_BINARY_DIR}/deps/lua/ /lib ${PROJECT_BINARY_DIR}/deps/lua/ /mw /selfcontained /p ${PROJECT_BINARY_DIR}/deps/luarocks/install /q /f" + COMMAND cmd //c "install.bat /lua ${PROJECT_BINARY_DIR}/deps/lua/ /inc ${PROJECT_BINARY_DIR}/deps/lua/ /lib ${PROJECT_BINARY_DIR}/deps/lua/ /mw /selfcontained /p ${PROJECT_BINARY_DIR}/deps/luarocks/install /q /f /noadmin" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/deps/luarocks/" ) else()