-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.32 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
name: Release .NET NuGet
on:
release:
types: [created]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add github packages store as NuGet source
run: |
dotnet nuget update source github `
--source https://nuget.pkg.github.com/aprismatic/index.json `
--username "${{ github.actor }}" `
--password "${{ github.token }}" `
--configfile ./nuget.config
- name: Restore packages
run: dotnet 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@v3
- name: Add github packages store as NuGet source
run: |
dotnet nuget update source github `
--source https://nuget.pkg.github.com/aprismatic/index.json `
--username "${{ github.actor }}" `
--password "${{ github.token }}" `
--configfile ./nuget.config
- name: Restore packages
run: dotnet 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" --skip-duplicate --api-key "${{ github.token }}"
- 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: ${{ github.token }}
with:
args: 'nupkgs/*'