chore: nuget PAT token #10
Workflow file for this run
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: Publish NuGet Package | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: 'global.json' | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: ImageSize | |
- name: Build | |
run: dotnet build --no-restore | |
working-directory: ImageSize | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
working-directory: ImageSize | |
- name: Extract version | |
id: get_version | |
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/v})" | |
- name: Pack | |
run: dotnet pack -c Release "./ImageSize/" -p:PackageVersion=${{ steps.get_version.outputs.version }} | |
- name: Push to NuGet | |
run: dotnet nuget push ImageSize/ImageSize/bin/Release/*.nupkg -k ${NUGET_TOKEN} -s https://nuget.pkg.github.com/dorucioclea/index.json --skip-duplicate --no-symbols true | |
env: | |
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |