Skip to content

v3.2.0

v3.2.0 #4

name: Build, Test, Publish
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: read
packages: write
env:
OWNER: "FModel"
jobs:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Run Tests
run: dotnet test -c Release --no-restore --no-build -v normal
- name: Pack NuGet Package(s)
run: dotnet pack -c Release --no-restore --no-build --output "${{ github.workspace }}/nuget-packages"
- name: Push NuGet Package(s) to nuget.org
run: |
dotnet nuget push "${{ github.workspace }}/nuget-packages/*.nupkg" \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate
- name: Add GitHub Packages source
run: |
dotnet nuget add source \
--username ${{ github.actor }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github \
"https://nuget.pkg.github.com/${{ env.OWNER }}/index.json"
- name: Push NuGet Package(s) to GitHub
run: |
dotnet nuget push "${{ github.workspace }}/nuget-packages/*.nupkg" \
--source github \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate