Skip to content

Merge branch 'v2-dev' #13

Merge branch 'v2-dev'

Merge branch 'v2-dev' #13

name: Build Windows
on:
push:
branches: [ master ]
paths:
- ".github/workflows/build_windows.yaml"
- "**.c"
- "**.h"
- "**.hpp"
- "**.cpp"
- "**.cmake"
- "**.patch"
- "**.ico"
- "**.rc"
- "**.json"
- "**.hpp.in"
- "**.py"
- "**/CMakeLists.txt"
repository_dispatch:
types: [ update ]
jobs:
build_windows:
#runs-on: windows-2022
runs-on: self-hosted
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Prepare
shell: powershell
run: |
# Set git tag
$PROJECT_TAG=git describe --tags --dirty --match "v*"
Add-Content -Path $env:GITHUB_ENV -Value "PROJECT_TAG=$PROJECT_TAG"
# Find compiler
$VCVAR_PATH=vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find "VC\**\vcvars64.bat"
if (-Not (Test-Path -Path "$VCVAR_PATH")) { Write-Error "VC++ compiler not found" -ErrorAction Stop }
Add-Content -Path $env:GITHUB_ENV -Value "VCVAR_PATH=$VCVAR_PATH"
# Create CPM cache folder
mkdir /cpm_cache -ErrorAction SilentlyContinue
Add-Content -Path $env:GITHUB_ENV -Value "CPM_SOURCE_CACHE=/cpm_cache"
# Create intermediate folders
mkdir cmake-build-x64
mkdir dist
- name: Build x64 Shipping
shell: cmd
run: |
call "%VCVAR_PATH%" x64
cd cmake-build-x64
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Ninja"
ninja -j %NUMBER_OF_PROCESSORS%
- name: Copy shipping build output
run: |
copy cmake-build-x64\src\v2\LuaSTGPlus2.exe dist\LuaSTGPlus2.exe
- name: Build x64 Development
shell: cmd
run: |
call "%VCVAR_PATH%" x64
cd cmake-build-x64
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Ninja" -DLSTG_SHIPPING=OFF
ninja -j %NUMBER_OF_PROCESSORS%
- name: Copy development build output
run: |
copy cmake-build-x64\src\v2\LuaSTGPlus2.exe dist\LuaSTGPlus2.dev.exe
- uses: actions/upload-artifact@v3
with:
name: LuaSTGPlus2-${{ env.PROJECT_TAG }}
path: |
dist/*.exe