Publish package to NuGet repository #6
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
# This workflow will publish a package when a release is created | |
name: Publish package to NuGet repository | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish-nuget: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Setup .NET Core @ Latest | |
uses: actions/setup-dotnet@v3 | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }} | |
- name: Build solution and generate NuGet package | |
run: | | |
dotnet pack -c Release -o out | |
- name: Push generated package to GitHub registry | |
run: | | |
cd out | |
dotnet nuget push "contentstack.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json | |
publish-git: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Setup .NET Core @ Latest | |
uses: actions/setup-dotnet@v3 | |
with: | |
source-url: https://nuget.pkg.github.com/Contentstack/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build solution and generate NuGet package | |
run: | | |
dotnet pack -c Release -o out | |
- name: Push generated package to GitHub registry | |
run: | | |
cd out | |
dotnet nuget push "contentstack.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json |