@@ -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,76 @@ 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
+ env :
89
+ NUGET_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
90
+
91
+ - run : dotnet nuget push "*.nupkg" --skip-duplicate
92
+ env :
93
+ NUGET_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
+
95
+ nuget-push-prod :
96
+ runs-on : ubuntu-latest
97
+ if : startsWith(github.ref, 'refs/tags/')
98
+ needs : build
99
+
100
+ steps :
101
+ - uses : actions/download-artifact@v2
102
+ with :
103
+ name : nugets
104
+
105
+ - uses : actions/setup-dotnet@v1
106
+ with :
107
+ dotnet-version : 2.1.401
108
+ source-url : https://api.nuget.org/v3/index.json
109
+ env :
110
+ NUGET_AUTH_TOKEN : ${{ secrets.NUGET_API_KEY }}
111
+
112
+ - run : dotnet nuget push nugets/*.nupkg --skip-duplicate
113
+
114
+ release-artifacts :
115
+ runs-on : ubuntu-latest
116
+ needs : build
117
+ if : startsWith(github.ref, 'refs/tags/')
118
+
119
+ steps :
120
+ - uses : actions/download-artifact@v1
121
+ with :
122
+ name : nugets
123
+
124
+ - name : Upload to stable release
125
+ uses : svenstaro/upload-release-action@v1-release
126
+ with :
127
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
128
+ file : nugets
129
+ asset_name : json-ld.net
130
+ tag : ${{ github.ref }}
131
+ overwrite : true
0 commit comments