Skip to content

Commit 9161b84

Browse files
Create nuget.yaml
1 parent d117109 commit 9161b84

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/nuget.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: NuGet
4+
5+
on:
6+
push:
7+
paths-ignore:
8+
- 'images/**'
9+
- 'docs/**'
10+
- 'examples/**'
11+
- 'packages/**'
12+
- 'README.md'
13+
tags:
14+
- '**'
15+
16+
jobs:
17+
build:
18+
runs-on: windows-latest
19+
defaults:
20+
run:
21+
shell: pwsh
22+
env:
23+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
24+
DOTNET_DISABLE_GUI_ERRORS: 1
25+
DOTNET_GENERATE_ASPNET_CERTIFICATE: 0
26+
DOTNET_NOLOGO: 1
27+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 10
34+
35+
- name: Setup .NET 6 SDK
36+
uses: actions/setup-dotnet@v2
37+
with:
38+
dotnet-version: 6.0.x
39+
include-prerelease: false
40+
41+
# Use vanilla NuGet.exe because dotnet nuget command has a bug: it ignores --source parameter
42+
- name: Setup NuGet.exe
43+
uses: NuGet/setup-nuget@v1
44+
with:
45+
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
46+
nuget-version: latest
47+
nuget-api-key-source: 'https://api.nuget.org/v3/index.json'
48+
49+
- name: Remove net framework example project
50+
run: dotnet sln remove "examples\NetFrameworkExample\NetFrameworkExample.csproj"
51+
52+
- name: Restore
53+
run: dotnet restore -p:Configuration=Release
54+
55+
- name: Build
56+
run: dotnet build -c Release --no-restore -p:SourceRevisionId=$(git rev-parse --short $env:GITHUB_SHA)
57+
58+
- name: Test
59+
run: |
60+
dotnet test -c Release --no-restore --no-build --verbosity normal
61+
- name: Push TBC.OpenAPI.SDK.ExchangeRates
62+
run: nuget push "src\TBC.OpenAPI.SDK.ExchangeRates\bin\Release\*.nupkg" -NonInteractive -SkipDuplicate -Source "https://api.nuget.org/v3/index.json" -NoSymbols -ForceEnglishOutput

0 commit comments

Comments
 (0)