Skip to content

Merge pull request #80 from ARKlab/renovate/nuget-messagepack-vulnera… #177

Merge pull request #80 from ARKlab/renovate/nuget-messagepack-vulnera…

Merge pull request #80 from ARKlab/renovate/nuget-messagepack-vulnera… #177

Workflow file for this run

name: "Deploy to NuGet"
on:
push:
branches: [ master ]
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+-beta[0-9][0-9]'
pull_request:
branches: [ master ]
env:
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
permissions:
contents: read
statuses: write
checks: write
jobs:
build:
name: 'Build'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install dotnet'
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: 'Restore packages'
run: dotnet restore
- name: 'Build project'
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --logger "trx;LogFileName=test-results.trx" --no-restore || true
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: DotNET Tests
path: "**/test-results.trx"
reporter: dotnet-trx
fail-on-error: true
deploy:
name: 'Nuget Push'
runs-on: 'windows-latest'
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install dotnet'
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: 'Get Version'
id: version
uses: battila7/get-version-action@v2
- name: 'Pack project'
run: dotnet pack --configuration Release --include-symbols -p:Version=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
# --no-build somehow cannot be used due to being needed:
- name: 'Push package'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}