Bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 #164
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: .NET | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Test | |
run: dotnet test -c Release --no-restore | |
- name: Pack (non-release) | |
if: github.event_name != 'release' | |
run: dotnet pack -c Release | |
- name: Pack and push to nuget.org (release) | |
if: github.event_name == 'release' | |
run: | | |
vertag=(${GITHUB_REF//\// }) | |
VERSION="${vertag[2]}" | |
[[ "${VERSION:0:1}" == "v" ]] && VERSION="${VERSION:1}" | |
[[ "$VERSION" =~ ^[1-9][0-9]*\.[0-9]+\.[0-9]+(-[a-z0-9]+\.[0-9]+|)$ ]] || (echo "Incorrect version! ($VERSION)"; exit 1) | |
dotnet pack -c Release -p:PackageVersion="$VERSION" -o nupkg src/ZCS.DataContractResolver/ZCS.DataContractResolver.csproj | |
dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} |