Magpie/.github/workflows/build.yml
2022-01-06 14:05:13 +08:00

53 lines
1.4 KiB
YAML

name: build
on:
push:
paths-ignore: [ 'docs/**', 'img/**', 'tools/**' ]
pull_request:
paths-ignore: [ 'docs/**', 'img/**', 'tools/**' ]
env:
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2.4.0
- name: Load Conan cache
uses: actions/cache@v2
with:
path: ./.conan/data
key: ${{ runner.os }}-conan-${{ hashFiles('**/conanfile.txt') }}
- name: Restore NuGet packages
run: nuget restore
- name: Setup Conan
run: pip install conan
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
with:
vs-prerelease: true
- name: Conan Install
run: msbuild /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ./CONAN_INSTALL
- name: Publish
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ./DEPLOY
- name: Save hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Store build
uses: actions/upload-artifact@v2
with:
name: Magpie_dev_${{ steps.vars.outputs.sha_short }}
path: ./publish/