Skip to content

Merge branch 'master' into dev #93

Merge branch 'master' into dev

Merge branch 'master' into dev #93

Workflow file for this run

name: .NET Build Workflow
on:
push:
branches: [ "dev", "master" ]
pull_request:
branches: [ "dev", "master" ]
workflow_dispatch:
inputs:
include_windows:
description: "Include windows"
default: true
type: boolean
jobs:
build-linux:
strategy:
fail-fast: false
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup Workload
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish for Linux
run: |
mkdir pub
dotnet publish -c Release -r linux-x64 InfrastSimExports
cp InfrastSimExports/bin/Release/net8.0/linux-x64/publish/InfrastSimExports.* pub/
- uses: actions/upload-artifact@v3
with:
name: InfrastSim-clib-linux
path: pub/*
build-windows:
strategy:
fail-fast: false
runs-on: windows-latest
# 只有当当前分支与 matrix 中的 branch 匹配时才运行 job
if: contains('master', github.ref_name) || inputs.include_windows
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup Workload
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish for Windows
run: |
mkdir pub
dotnet publish -c Release -r win-x64 InfrastSimExports
cp InfrastSimExports/bin/Release/net8.0/win-x64/publish/InfrastSimExports.* pub/
- uses: actions/upload-artifact@v3
with:
name: InfrastSim-clib-win
path: pub/*