Skip to content

Workflow file for this run

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 ${GITHUB_TOKEN} -s https://nuget.pkg.github.com/dorucioclea/index.json --skip-duplicate --no-symbols true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}