-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (47 loc) · 2.03 KB
/
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
59
60
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: NuGet
on:
push:
tags:
- '**'
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: pwsh
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_DISABLE_GUI_ERRORS: 1
DOTNET_GENERATE_ASPNET_CERTIFICATE: 0
DOTNET_NOLOGO: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore
run: dotnet restore -p:Configuration=Release
- name: Strong Name Key Pair
run: |
$snk = [Convert]::FromBase64String('${{ secrets.STRONG_NAME_KEY }}')
[IO.File]::WriteAllBytes("$env:GITHUB_WORKSPACE\keypair.snk", $snk)
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: |
dotnet test -c Release --no-build --no-restore --verbosity normal '--collect:"XPlat Code Coverage"' --results-directory "$env:GITHUB_WORKSPACE/coverage/" --% -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.SkipAutoProps=true
echo "CODE_COVERAGE_PATH=$($(dir "$env:GITHUB_WORKSPACE/coverage/" -Filter 'coverage.cobertura.xml' -Recurse | select -first 1).FullName)" >> $GITHUB_ENV
- name: Clean
run: dotnet clean
- name: Pack
run: |
$snk = "$env:GITHUB_WORKSPACE\keypair.snk"
dotnet pack "$(dir TBC.Common.Configuration.Registry.csproj -Recurse | select -first 1 -expand FullName)" -c Release "-p:SourceRevisionId=$(git rev-parse --short $env:GITHUB_SHA)" -p:SignAssembly=True -p:DelaySign=False "-p:AssemblyOriginatorKeyFile=$snk"
del $snk -Force -Verbose
- name: Push
run: dotnet nuget push "**\*.nupkg" -k "${{ secrets.NUGET_API_KEY }}" -s "https://api.nuget.org/v3/index.json" -n --skip-duplicate --force-english-output