这是indexloc提供的服务,不要输入任何密码
Skip to content

improving dying. fixing errors when a patient missed dying due to bei… #169

improving dying. fixing errors when a patient missed dying due to bei…

improving dying. fixing errors when a patient missed dying due to bei… #169

Workflow file for this run

---
name: Windows
on:
push:
branches-ignore:
- 'gh-pages'
pull_request:
workflow_dispatch:
inputs:
preset:
description: 'Select CMake preset'
default: 'win-x64-rel'
type: choice
options:
- win-dev
- win-x64-rel
- win-x86-rel
animview:
description: 'Build AnimView?'
default: 'false'
type: boolean
pr:
description: 'Build this PR (optional)'
type: number
jobs:
Windows:
runs-on: windows-2022
env:
PRESET: ${{inputs.preset || 'win-x64-rel'}}
ANIMVIEW: ${{inputs.animview && 'ON' || 'OFF'}}
NAME: CorsixTH${{inputs.animview && '_and_AnimView' || ''}}${{inputs.preset == 'win-x86-rel' && '_x86' || ''}}
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout selected PR
env:
GH_TOKEN: ${{github.token}}
if: inputs.PR
run: gh pr checkout --repo CorsixTH/CorsixTH ${{inputs.pr}}
- name: Restore vcpkg cache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{env.PRESET}}-${{hashFiles('vcpkg.json','vcpkg-configuration.json')}}
restore-keys: vcpkg-${{env.PRESET}}-
- name: Get CMake
uses: lukka/get-cmake@v3.28.3
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
vcpkgConfigurationJsonGlob: 'vcpkg-configuration.json'
- name: Run CMake dev configure
if: inputs.PRESET == 'win-dev'
uses: lukka/run-cmake@v10
with:
configurePreset: 'win-dev'
- name: Run CMake release build
if: inputs.PRESET != 'win-dev'
uses: lukka/run-cmake@v10
with:
configurePreset: ${{env.PRESET}}
configurePresetAdditionalArgs: "['-DBUILD_ANIMVIEW=${{env.ANIMVIEW}}',
'-DCMAKE_INSTALL_PREFIX=build/${{env.PRESET}}/CorsixTH/RelWithDebInfo/']"
buildPreset: ${{env.PRESET}}
buildPresetAdditionalArgs: "['--verbose', '--target install']"
testPreset: ${{env.PRESET}}
- name: Save vcpkg cache
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{env.PRESET}}-${{hashFiles('vcpkg.json','vcpkg-configuration.json')}}
- name: Download soundfont
if: inputs.PRESET != 'win-dev'
run: |
aria2c -d "build/${{env.PRESET}}/CorsixTH/RelWithDebInfo" \
https://raw.githubusercontent.com/Jacalz/fluid-soundfont/master/SF3/FluidR3.sf3
- name: Copy data files for archive
if: inputs.PRESET != 'win-dev'
run: |
cp -r build/${{env.PRESET}}/. .
cp -Ru CorsixTH/RelWithDebInfo/CorsixTH/. CorsixTH/RelWithDebInfo/
rm -rf CorsixTH/RelWithDebInfo/CorsixTH/
if [ "${{inputs.animview}}" == "true" ]; then
mkdir -p artifact
mv AnimView/RelWithDebInfo artifact/AnimView
mv CorsixTH/RelWithDebInfo artifact/CorsixTH
else
mv CorsixTH/RelWithDebInfo artifact
fi
ls -R artifact
- name: Upload build
if: inputs.PRESET != 'win-dev'
uses: actions/upload-artifact@v4
with:
path: artifact
name: ${{env.NAME}}