-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (38 loc) · 1.49 KB
/
nuget_package_push.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
name: Nuget Release
on:
push:
tags:
- v*
jobs:
pushrelease:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: olegtarasov/get-tag@v2.1
id: tagChrono
with:
tagRegex: "v(\\d+\\.\\d+\\.\\d+)"
- name: Build/Check for compile errors (dotnet build)
working-directory: "ChronoJsonDiffPatch"
run: dotnet build --configuration Release
- name: Run Unit Tests (dotnet test)
working-directory: "ChronoJsonDiffPatch"
run: dotnet test --configuration Release
- name: Create Package ChronoJsonDiffPatch (dotnet pack)
working-directory: "ChronoJsonDiffPatch/ChronoJsonDiffPatch"
run: dotnet pack ChronoJsonDiffPatch.csproj --configuration Release -p:PackageVersion="${{ steps.tagChrono.outputs.tag }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Nuget push ChronoJsonDiffPatch
working-directory: "ChronoJsonDiffPatch/ChronoJsonDiffPatch"
# token: https://github.com/Hochfrequenz/chrono_json_diff_patch/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN
# expires 2024-02-02
run: |
nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }}
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols