Skip to content

Build

Build #1

Workflow file for this run

name: Build
on:
workflow_dispatch:
env:
DOTNET_VERSION: 7.0.x
jobs:
build-and-publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
runtime-identifier: linux-x64
- os: windows-latest
runtime-identifier: win-x64
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Nuget cache
uses: actions/cache@v4
with:
path:
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build -c Release
- name: Publish Engine
run: dotnet publish Snail-Chess.Cmd/Snail-Chess.Cmd.csproj -c Release --runtime ${{ matrix.runtime-identifier }} -o artifacts/${{ matrix.runtime-identifier }}
- name: Upload Snail-Chess-${{ github.run_number }}-${{ matrix.runtime-identifier }} artifact
uses: actions/upload-artifact@v4
with:
name: Snail-Chess-${{ github.run_number }}-${{ matrix.runtime-identifier }}
path: |
artifacts/${{ matrix.runtime-identifier }}/
!artifacts/**/*.pdb
if-no-files-found: error