Skip to content

Commit

Permalink
Create dotnet-desktop.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
optimus-code authored Aug 18, 2024
1 parent 3d3d300 commit 8d063f6
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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

0 comments on commit 8d063f6

Please sign in to comment.