Update dependency Microsoft.NET.Test.Sdk to 17.12.0 #361
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build, Test and Pack" | |
on: | |
push: | |
branches: [ master ] | |
# Trigger on release tags | |
tags: [ 'v[0-9]+*' ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} | |
build-and-test: | |
name: "Build and Test" | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: '0' | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
with: | |
dotnet-version: 6.0.x | |
- name: Build | |
run: dotnet build --configuration Release | |
- name: Test | |
run: dotnet test --configuration Release --no-build -- NUnit.TestOutputXml=TestResults | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: Test Results (${{matrix.os}}) | |
path: "**/TestResults/*.xml" | |
- name: Pack | |
run: dotnet pack --configuration Release --no-build --include-symbols | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: nugetcleaner-nugetpackage | |
path: | | |
output/Release/*.nupkg | |
output/Release/*.snupkg | |
if: matrix.os == 'ubuntu-latest' | |
publish-nuget: | |
name: "Publish NuGet package" | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
if: github.event_name == 'push' | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: artifacts | |
- name: Publish to Nuget | |
run: dotnet nuget push artifacts/**/*.*nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.SILLSDEV_PUBLISH_NUGET_ORG}} --skip-duplicate |