Skip to content

.NET

.NET #1

name: .NET
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore ./RmSharp/RmSharp.csproj
- name: Build
run: dotnet build --configuration Release --no-restore ./RmSharp/RmSharp.csproj
# Comment out the Test step if it's causing issues
#- name: Test
# run: dotnet test --no-build --verbosity normal ./RmSharp.Tests/RmSharp.Tests.csproj
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore ./RmSharp/RmSharp.csproj
- name: Build
run: dotnet build --configuration Release --no-restore ./RmSharp/RmSharp.csproj
- name: Pack NuGet package
run: dotnet pack --configuration Release --no-build --output ./nupkg ./RmSharp/RmSharp.csproj
- name: Publish NuGet package to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
- name: Publish NuGet package to nuget.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json