Skip to content

Publish NStack.Core to NuGet #12

Publish NStack.Core to NuGet

Publish NStack.Core to NuGet #12

Workflow file for this run

name: Publish NStack.Core to NuGet
on:
push:
tags:
- v*
jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 #fetch-depth is needed for GitVersion
- name: Install and calculate the new version with GitVersion
uses: gittools/actions/gitversion/setup@v0.9.13
with:
versionSpec: 5.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.13
id: gitversion # step id used as reference for output values
- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build Release
run: |
dotnet-gitversion /updateprojectfiles
dotnet build --no-restore -c Release
- name: Pack
run: dotnet pack -c Release -p:Version='${{ steps.gitversion.outputs.SemVer }}' -v d
#- name: Prep GitHub Packages
# run: dotnet nuget add source --username tig --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/tig/index.json"
#- name: Publish to GitHub packages
# run: dotnet nuget push NStack/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"
- name: Publish to NuGet.org
run: dotnet nuget push NStack/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json