Skip to content

Commit

Permalink
Fix the windows build on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vaartis committed Apr 30, 2020
1 parent efd4bcf commit 8975215
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
69 changes: 56 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}/
Expand All @@ -43,15 +43,58 @@ jobs:
submodules: recursive

- name: Install MSYS2
uses: numworks/setup-msys2@v1
uses: eine/setup-msys2@v0

This comment has been minimized.

Copy link
@eine

eine Jun 6, 2020

I suggest updating to eine/setup-msys2@v1, for significantly reduced startup time. See msys2/setup-msys2#23.

This comment has been minimized.

Copy link
@vaartis

vaartis Jun 10, 2020

Author Owner

Thank you. I will.

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"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8975215

Please sign in to comment.