Skip to content

Workflow file for this run

name: DotNet-RestAPI V2 Publish to Nuget
on:
release:
types: [published]
jobs:
buildandpublish:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.x.x
2.2.x
3.1.x
5.0.x
6.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Restore Tests
run: dotnet restore Avalara.AvaTax.RestClient.Test.csproj
working-directory: tests
- name: Create Assembly Signing Key
run: |
echo "${{ secrets.ASSEMBLY_SIGNING_KEY }}" > data.b64 && certutil -decode data.b64 Avalara.AvaTax.RestClient.snk
working-directory: src
- name: Build Tests
run: dotnet build Avalara.AvaTax.RestClient.Test.csproj --no-restore --configuration Release
working-directory: tests
- name: Run Tests
run: dotnet test Avalara.AvaTax.RestClient.Test.csproj --no-build --configuration Release
env:
SANDBOX_USERNAME: ${{ secrets.SANDBOX_USERNAME }}
SANDBOX_PASSWORD: ${{ secrets.SANDBOX_PASSWORD }}
working-directory: tests
- name: Build Package
run: dotnet build --no-restore --configuration Release
working-directory: src
- name: Pack Package
run: dotnet pack Avalara.AvaTax.RestClient.csproj -p:NuspecFile=Avalara.AvaTax.RestClient.nuspec -o . --no-build --configuration Release
working-directory: src
- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: 'latest'
- name: Publish Package to Nuget
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json'