Publish MSTestX.UnitTestRunner to NuGet #9
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
name: Publish MSTestX.UnitTestRunner to NuGet | |
on: | |
workflow_dispatch: | |
inputs: | |
publish-adapter: | |
description: Whether to also publish MSTestX.Adapter | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
build: | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Visual Studio Command Prompt | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Get certificate | |
id: cert_file | |
uses: timheuer/base64-to-file@v1.2 | |
with: | |
fileName: 'certfile.pfx' | |
encodedString: ${{ secrets.BASE64_ENCODED_PFX }} | |
- name: Build | |
run: | | |
msbuild /restore /t:Build,Pack src/TestAppRunner/TestAppRunner/TestAppRunner.csproj /p:Configuration=Release /p:Configuration=Release /p:CertificatePath=${{ steps.cert_file.outputs.filePath }} /p:CertificatePassword=${{ secrets.PFX_PASSWORD }} | |
- name: Sign NuGet Package | |
run: | | |
dotnet nuget sign nupkg\*.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.PFX_PASSWORD }} --timestamper http://timestamp.digicert.com | |
dotnet nuget sign nupkg\*.snupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.PFX_PASSWORD }} --timestamper http://timestamp.digicert.com | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: NuGet Packages | |
path: nupkg | |
- name: Push MSTestX.TestAdapter to NuGet | |
if: ${{ inputs.publish-adapter }} | |
run: | | |
dotnet nuget push nupkg\MSTestX.TestAdapter.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org | |
dotnet nuget push nupkg\MSTestX.TestAdapter.*.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org | |
- name: Push MSTestX.UnitTestRunner to NuGet | |
run: | | |
dotnet nuget push nupkg\MSTestX.UnitTestRunner.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org | |
dotnet nuget push nupkg\MSTestX.UnitTestRunner.*.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org |