-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (47 loc) · 2.14 KB
/
publish_mstestx_nuget.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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