Skip to content

.NET Build/Publish

.NET Build/Publish #2

name: .NET Release
on: [release]
env:
CONFIGURATION: Release
GLOBALJSON: .\src\global.json
PROJECTPATH: .\src\MauiNUnitRunner.Controls
TESTPROJECTPATH: .\src\MauiNUnitRunner.Controls.Tests
SOLUTION: .\src\MauiNUnitRunner.sln
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup .NET
uses: actions/[email protected]
with:
global-json-file: ${{ env.GLOBALJSON }}
source-url: https://nuget.pkg.github.com/bstadick/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Nuget.exe
uses: nuget/[email protected]
with:
nuget-api-key: ${{ secrets.GITHUB_TOKEN }}
- name: Build with dotnet
run: dotnet build "${{ env.SOLUTION }}" -c ${{ env.CONFIGURATION }}
- name: Build examples with dotnet
run: dotnet build "${{ env.SOLUTION }}" -c Example
- name: Test with dotnet
run: dotnet test "${{ env.SOLUTION }}" -c UnitTest
- name: Pack with dotnet
run: dotnet pack "${{ env.SOLUTION }}" -c ${{ env.CONFIGURATION }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: production-artifacts
path: |
${{ env.PROJECTPATH }}\bin\${{ env.CONFIGURATION }}\*.nupkg
${{ env.TESTPROJECTPATH }}\TestResults\*.trx
- name: Deploy to GPR with dotnet
run: dotnet nuget push "${{ env.PROJECTPATH }}\bin\${{ env.CONFIGURATION }}\*.nupkg" -s https://nuget.pkg.github.com/bstadick/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate