Skip to content

Merge pull request #3 from myssto/multi-target-build #6

Merge pull request #3 from myssto/multi-target-build

Merge pull request #3 from myssto/multi-target-build #6

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests
run: dotnet test --no-build --no-restore --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults
- name: Upload coverage report
if: github.ref == 'refs/heads/master'
uses: coverallsapp/github-action@v2
publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build OpenSkillSharp/OpenSkillSharp.csproj --configuration Release --no-restore
- name: Pack
run: dotnet pack OpenSkillSharp/OpenSkillSharp.csproj --configuration Release --no-build --output ./nupkg /p:Version=${GITHUB_REF#refs/tags/v}
- name: Publish to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json