-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.86 KB
/
dotnet_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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: .NET Debug Test and Publish Nuget Package
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
env:
Solution_Name: Xcaciv.Command.sln
Nuget_Project_Path: src\Xcaciv.Command\Xcaciv.Command.csproj
Nuget_Config_Path: NuGet.config
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Configure Nuget Source - configure
run: |
dotnet nuget update source github -s "https://nuget.pkg.github.com/xcaciv/index.json" -u xcaciv -p ${{ secrets.NUGET_PAT }} --store-password-in-clear-text --configfile $env:Nuget_Config_Path
- name: Configure Nuget Source - remove
run: |
dotnet nuget remove source local
- name: Restore dependencies
run: dotnet restore $env:Solution_Name
- name: Debug Build
run: dotnet build $env:Solution_Name --no-restore --configuration Debug
- name: Test with dotnet
run: dotnet test $env:Solution_Name --no-build --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload dotnet test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
- name: Release Build
run: |
dotnet build $env:Nuget_Project_Path --no-restore --configuration Release
- name: Nuget Package
run: |
dotnet pack $env:Nuget_Project_Path --configuration Release
- name: Nuget Push
run: |
dotnet nuget push **\*.nupkg -k ${{ secrets.NUGET_PAT }} -s "github" --skip-duplicate
- name: Cleanup
if: always()
continue-on-error: true
run: |
dotnet nuget remove source github