@@ -3,6 +3,7 @@ name: dotnet
3
3
on :
4
4
push :
5
5
branches : [master]
6
+ tags : ["*"]
6
7
pull_request :
7
8
branches : [master]
8
9
@@ -18,12 +19,12 @@ jobs:
18
19
with :
19
20
fetch-depth : 0
20
21
21
- -
uses :
gittools/actions/gitversion/[email protected] .3
22
+ -
uses :
gittools/actions/gitversion/[email protected] .4
22
23
with :
23
24
versionSpec : " 5.x"
24
25
25
26
- id : gitversion
26
- uses :
gittools/actions/gitversion/[email protected] .3
27
+ uses :
gittools/actions/gitversion/[email protected] .4
27
28
28
29
- uses : actions/setup-dotnet@v1
29
30
with :
@@ -55,18 +56,72 @@ jobs:
55
56
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
56
57
run : bash <(curl -s https://codecov.io/bash)
57
58
58
- - name : NuGet Pack
59
- run : |
59
+ - run : |
60
60
dotnet pack \
61
61
--include-source \
62
62
--configuration Release \
63
63
--no-build \
64
64
--no-restore \
65
65
-p:PackageVersion="${{ steps.gitversion.outputs.fullSemVer }}" \
66
66
src/json-ld.net/json-ld.net.csproj \
67
- --output nugets/
67
+ --output ${{ github.workspace }}/ nugets/
68
68
69
69
- uses : actions/upload-artifact@v2
70
70
with :
71
71
name : nugets
72
72
path : nugets
73
+
74
+ nuget-push-dev :
75
+ runs-on : ubuntu-latest
76
+ if : startsWith(github.ref, 'refs/tags/') != true
77
+ needs : build
78
+
79
+ steps :
80
+ - uses : actions/download-artifact@v2
81
+ with :
82
+ name : nugets
83
+
84
+ - uses : actions/setup-dotnet@v1
85
+ with :
86
+ dotnet-version : 3.1
87
+ source-url : https://nuget.pkg.github.com/linked-data-dotnet/index.json
88
+
89
+ - run : dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }}
90
+
91
+ nuget-push-prod :
92
+ runs-on : ubuntu-latest
93
+ if : startsWith(github.ref, 'refs/tags/')
94
+ needs : build
95
+
96
+ steps :
97
+ - uses : actions/download-artifact@v2
98
+ with :
99
+ name : nugets
100
+
101
+ - uses : actions/setup-dotnet@v1
102
+ with :
103
+ dotnet-version : 2.1.401
104
+ source-url : https://api.nuget.org/v3/index.json
105
+ env :
106
+ NUGET_AUTH_TOKEN : ${{ secrets.NUGET_API_KEY }}
107
+
108
+ - run : dotnet nuget push nugets/*.nupkg --skip-duplicate
109
+
110
+ release-artifacts :
111
+ runs-on : ubuntu-latest
112
+ needs : build
113
+ if : startsWith(github.ref, 'refs/tags/')
114
+
115
+ steps :
116
+ - uses : actions/download-artifact@v1
117
+ with :
118
+ name : nugets
119
+
120
+ - name : Upload to stable release
121
+ uses : svenstaro/upload-release-action@v1-release
122
+ with :
123
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
124
+ file : nugets
125
+ asset_name : json-ld.net
126
+ tag : ${{ github.ref }}
127
+ overwrite : true
0 commit comments