From 8d063f67b36610534732b5ff7046ff78ba1b8d0e Mon Sep 17 00:00:00 2001 From: Dan <12039578+optimus-code@users.noreply.github.com> Date: Sun, 18 Aug 2024 22:26:51 +0100 Subject: [PATCH] Create dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..a9b67cc --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -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