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