Skip to content

chore: workflow

chore: workflow #1

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@v2
- 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
- name: Build
run: dotnet build --no-restore
working-directory: ImageSize
- name: Test
run: dotnet test --no-build --verbosity normal
working-directory: ImageSize
- name: Pack
run: dotnet pack --no-build --configuration Release /p:PackageVersion=${{ github.ref }} -o out
working-directory: ImageSize
- name: Push to NuGet
# run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# working-directory: ImageSize
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 }}