Skip to content

Release 2.0 (#11)

Release 2.0 (#11) #9

Workflow file for this run

name: NuGet Packages CD
on:
push:
tags: [ '**' ]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
Pack:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
with:
# https://github.com/actions/checkout/issues/701 https://github.com/actions/checkout/pull/579
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
8.0.x
- run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
# Remove Meziantou.Analyzer from all projects (Roslyn analyzer which does not need to pollute the nuget package)
- run: dotnet remove package Meziantou.Analyzer
working-directory: src/Doki.Abstractions
- run: dotnet pack -c Release -p:Version=$VERSION
- uses: actions/upload-artifact@v3
with:
name: NuGet
path: ./nuget
Publish:
runs-on: ubuntu-latest
needs: Pack
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- uses: actions/download-artifact@v3
with:
name: NuGet
path: ./nuget
- run: dotnet nuget push ./nuget/**.nupkg --source nuget.org --api-key ${{ secrets.NUGET_API_KEY }}