-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (76 loc) · 2.53 KB
/
release-dotnet-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
name: Release .NET NuGet
on:
release:
types: [created]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dotnet 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Setup nuget
uses: nuget/setup-nuget@v1
- name: Update nuget source
run: |
nuget sources update -Name 'github' `
-Source https://nuget.pkg.github.com/aprismatic/index.json `
-UserName ${{ secrets.GH_USERNAME }} `
-Password ${{ secrets.GH_TOKEN }} `
-ConfigFile ./nuget.config
- name: Restore packages
run: nuget restore
- name: Build with dotnet
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --configuration Release --no-build
publish:
needs: test
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dotnet 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Setup nuget
uses: nuget/setup-nuget@v1
- name: Update nuget source
run: |
nuget sources update -Name 'github' `
-Source https://nuget.pkg.github.com/aprismatic/index.json `
-UserName ${{ secrets.GH_USERNAME }} `
-Password ${{ secrets.GH_TOKEN }} `
-ConfigFile ./nuget.config
- name: Restore packages
run: nuget restore
- name: Build with dotnet
run: dotnet build --configuration Release --no-restore -p:Version=${{ github.event.release.tag_name }}
- name: Pack nuget packages
run: dotnet pack --configuration Release --no-build --output nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ github.event.release.tag_name }}
- name: Publish nuget packages
run: dotnet nuget push **/*.nupkg --source "github"
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: nupkgs
path: nupkgs
release:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: nupkgs
path: nupkgs
- name: Release artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
args: 'nupkgs/*'