Skip to content

Update dotnet.yml

Update dotnet.yml #87

Workflow file for this run

name: .NET Build Workflow
on:
push:
branches: [ "dev", "master" ]
pull_request:
branches: [ "dev", "master" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- branch: dev
os: ubuntu-latest
platform: "linux-x64"
- branch: master
os: windows-latest
platform: "win-x64"
- branch: master
os: ubuntu-latest
platform: "linux-x64"
runs-on: ${{ matrix.os }}
# 只有当当前分支与 matrix 中的 branch 匹配时才运行 job
if: contains(matrix.branch, github.ref_name)

Check failure on line 28 in .github/workflows/dotnet.yml

View workflow run for this annotation

GitHub Actions / .NET Build Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet.yml (Line: 28, Col: 9): Unrecognized named-value: 'matrix'. Located at position 10 within expression: contains(matrix.branch, github.ref_name)
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- 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 ${{ matrix.platform }}
run: |
mkdir pub
dotnet publish -c Release -r ${{ matrix.platform }} InfrastSimExports
cp InfrastSimExports/bin/Release/net8.0/${{ matrix.platform }}/publish/InfrastSimExports.* pub/
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}
path: pub/*