-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (79 loc) · 3.75 KB
/
release_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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Nuget Release
on:
release:
types: [created, edited]
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100
- name: Build/Check for compile errors (dotnet build)
run: dotnet build --configuration Release
- name: Run Unit Tests (dotnet test) # never ever release with failing tests!
run: dotnet test --configuration Release
push_release:
needs: run_tests
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100
- uses: olegtarasov/get-tag@v2.1
id: tagTBC
with:
tagRegex: "v(\\d+\\.\\d+\\.\\d+)"
- name: Build/Check for compile errors (dotnet build)
run: dotnet build --configuration Release
- name: Create Package EDILibrary (dotnet pack)
working-directory: "EDILibrary"
run: dotnet pack EDILibrary.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Nuget push EDILibrary and EDILibrary.Core
working-directory: "EDILibrary"
# token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN
run: |
nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }}
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols
- name: Create Package EDILibrary.Standard (dotnet pack)
working-directory: "EDILibraryBase"
run: dotnet pack EDILibrary.Standard.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Nuget push EDILibrary.Standard
working-directory: "EDILibraryBase"
# token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN
run: |
nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }}
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols
- name: Create Package EDIFileLoader.Core (dotnet pack)
working-directory: "EDIFileLoader"
run: dotnet pack EDIFileLoader.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Nuget push EDIFileLoader.Core
working-directory: "EDIFileLoader"
# token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN
run: |
nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }}
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols
- name: Create Package EDIFileLoader.Standard (dotnet pack)
working-directory: "EDIFileLoader.Standard"
run: dotnet pack EDIFileLoader.Core.csproj --configuration Release -p:PackageVersion="${{ steps.tagTBC.outputs.tag }}"
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: Nuget push EDIFileLoader.Standard
working-directory: "EDIFileLoader.Standard"
# token: https://github.com/Hochfrequenz/EDILibrary/settings/secrets/actions/NUGET_ORG_PUSH_TOKEN
run: |
nuget setApiKey ${{ secrets.NUGET_ORG_PUSH_TOKEN }}
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NoSymbols