Skip to content

Switch to Vcpkg manifest #63

Switch to Vcpkg manifest

Switch to Vcpkg manifest #63

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: MSBuild
on:
push:
pull_request:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: build\Incursion.sln
# Generated files to clean and check
GENERATED_FILES: src/tokens.cpp src/yygram.cpp inc/yygram.h
permissions:
contents: read
jobs:
build:
strategy:
matrix:
configuration: ["Release", "Debug"]
platform: ["Win32", "x64"]
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Setup Vcpkg
run: |
./build/vcpkg/bootstrap-vcpkg.bat
./build/vcpkg/vcpkg.exe integrate install
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Clean generated files
if: matrix.platform == 'Win32' && matrix.configuration == 'Debug'
shell: bash
run: rm -v ${{env.GENERATED_FILES}}
- name: Build
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}}
- name: Verify generated files
run: git diff --exit-code ${{env.GENERATED_FILES}}
- name: Copy binaries to project root
shell: bash
run: cp -v build/*/*/exe_libtcod/Incursion.exe build/*/*/exe_libtcod/*.dll .
- name: Compile mod
if: matrix.configuration == 'Debug'
shell: bash
run: ./Incursion.exe -compile
- name: Upload mod
if: matrix.configuration == 'Debug'
uses: actions/upload-artifact@v4
with:
name: mod-${{ matrix.platform }}
path: mod
retention-days: 1
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: direct-binaries-${{matrix.configuration}}-${{matrix.platform}}
path: |
*.exe
*.dll
retention-days: 1
package:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
platform: ["Win32", "x64"]
steps:
- uses: actions/checkout@v4
- name: Fetch mod
uses: actions/download-artifact@v4
with:
name: mod-${{ matrix.platform }}
path: mod
- name: Fetch binaries
uses: actions/download-artifact@v4
with:
name: direct-binaries-Release-${{matrix.platform}}
path: .
- name: Package Incursion
uses: actions/upload-artifact@v4
with:
name: Incursion-${{matrix.platform}}
path: |
*.exe
*.dll
*.md
*.txt
fonts
docs
mod
retention-days: 30
compression-level: 9