Update windows.yml #132
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: Windows | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
OUTPUT_DIR: output | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
msystem: [MINGW64] | |
build-type: [Release, Debug] | |
include: | |
- msystem: MINGW64 | |
arch: x86_64 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{matrix.msystem}} | |
install: >- | |
make | |
pkg-config | |
gcc | |
git | |
- name: Install Additional Packages | |
run: | | |
pacman -S --noconfirm \ | |
mingw-w64-${{matrix.arch}}-cmake \ | |
mingw-w64-${{matrix.arch}}-luajit \ | |
mingw-w64-${{matrix.arch}}-gcc | |
- uses: actions/checkout@v2 | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Create Output Directory | |
run: mkdir $(realpath ${{env.OUTPUT_DIR}}) | |
- name: Configure CMake | |
run: | | |
OUT_DIR=$(realpath ${{env.OUTPUT_DIR}}) && \ | |
cmake -B build -G "MSYS Makefiles" \ | |
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$OUT_DIR \ | |
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$OUT_DIR \ | |
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} | |
- name: Build | |
run: cmake --build build --target procyon-lua | |
- name: Clean Up | |
run: rm -f ${{env.OUTPUT_DIR}}/genhexer ${{env.OUTPUT_DIR}}/*ltrans* ${{env.OUTPUT_DIR}}/*wpa* | |
- name: Strip Binaries | |
run: strip --strip-unneeded ${{env.OUTPUT_DIR}}/* | |
if: matrix.build-type == 'Release' | |
- name: Copy Misc. Files | |
run: | | |
mkdir ${{env.OUTPUT_DIR}}/script && \ | |
cp lua/sample/main.lua ${{env.OUTPUT_DIR}}/script/main.lua && \ | |
cp lua/sample/util.lua ${{env.OUTPUT_DIR}}/script/util.lua && \ | |
cp lua/sample/sprites.png ${{env.OUTPUT_DIR}}/sprites.png && \ | |
cp lua/sample/CREDIT ${{env.OUTPUT_DIR}}/CREDIT && \ | |
cp lua/README.md ${{env.OUTPUT_DIR}}/README.md && \ | |
cp -r include ${{env.OUTPUT_DIR}}/include | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-${{matrix.arch}}-${{matrix.build-type}} | |
path: ${{env.OUTPUT_DIR}} | |