Skip to content

Merge pull request #215 from WiseTechGlobal/yaakov/372 #20

Merge pull request #215 from WiseTechGlobal/yaakov/372

Merge pull request #215 from WiseTechGlobal/yaakov/372 #20

Workflow file for this run

name: Publish Package Release
on:
push:
tags:
- '*'
jobs:
publish-nupkg:
name: Publish NuGet Package
runs-on: windows-latest
steps:
- name: Extract tag name
id: tag_name
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
return context.payload.ref.replace(/^refs\/tags\//, '');
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
- name: Workaround for https://github.com/dotnet/core/issues/5881
run: dotnet nuget locals all --clear
- name: Create NuGet Packages
run: dotnet pack src --configuration Release /p:CommitID=${{ github.sha }} /p:TagVersion=${{ steps.tag_name.outputs.result }}
- name: Upload WTG.Analyzers nupkg
uses: actions/upload-artifact@v2
with:
name: WTG.Analyzers.${{ steps.tag_name.outputs.result }}.nupkg
path: 'bin/WTG.Analyzers.${{ steps.tag_name.outputs.result }}.nupkg'
- name: Upload WTG.Analyzers.Utils nupkg
uses: actions/upload-artifact@v2
with:
name: WTG.Analyzers.Utils.${{ steps.tag_name.outputs.result }}.nupkg
path: 'bin/WTG.Analyzers.Utils.${{ steps.tag_name.outputs.result }}.nupkg'
- name: Upload WTG.Analyzers.TestFramework nupkg
uses: actions/upload-artifact@v2
with:
name: WTG.Analyzers.TestFramework.${{ steps.tag_name.outputs.result }}.nupkg
path: 'bin/WTG.Analyzers.TestFramework.${{ steps.tag_name.outputs.result }}.nupkg'
- name: Publish NuGet Package to NuGet Gallery
run: |
nuget setapikey ${{ secrets.NUGET_API_KEY }}
nuget push bin/WTG.Analyzers.${{ steps.tag_name.outputs.result }}.nupkg -Source https://api.nuget.org/v3/index.json
nuget push bin/WTG.Analyzers.Utils.${{ steps.tag_name.outputs.result }}.nupkg -Source https://api.nuget.org/v3/index.json
nuget push bin/WTG.Analyzers.TestFramework.${{ steps.tag_name.outputs.result }}.nupkg -Source https://api.nuget.org/v3/index.json