31
31
with :
32
32
fetch-depth : 0
33
33
34
- - name : Setup .NET
35
- uses : actions/setup-dotnet@v4
36
-
37
34
- name : Build
38
35
run : dotnet build -c Release
39
36
@@ -56,14 +53,14 @@ jobs:
56
53
57
54
- name : Pack NuGet artifacts
58
55
if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
59
- run : dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}"
56
+ run : dotnet pack --no-build -c Release -p:PackageVersion="${{ env.VERSION }}" -o packages
60
57
61
58
- name : Upload artifacts
62
59
if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
63
60
uses : actions/upload-artifact@v4
64
61
with :
65
- name : nupkgs
66
- path : src/** /*nupkg
62
+ name : packages
63
+ path : packages /*nupkg
67
64
68
65
github :
69
66
name : Deploy to GitHub
@@ -74,26 +71,44 @@ jobs:
74
71
- name : Download artifacts
75
72
uses : actions/download-artifact@v4
76
73
with :
77
- name : nupkgs
74
+ name : packages
78
75
- name : Push to GitHub
79
76
run : |
80
- dotnet nuget push "**/* .nupkg" \
77
+ dotnet nuget push "*.nupkg" \
81
78
--skip-duplicate \
82
79
-k ${{ secrets.GITHUB_TOKEN }} \
83
80
-s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
84
81
82
+ release :
83
+ name : Create GitHub release
84
+ needs : [build-windows, build-linux]
85
+ if : startsWith(github.ref, 'refs/tags/v')
86
+ runs-on : ubuntu-24.04
87
+ steps :
88
+ - name : Checkout
89
+ uses : actions/checkout@v4
90
+ - name : Download artifacts
91
+ uses : actions/download-artifact@v4
92
+ with :
93
+ name : packages
94
+ path : packages
95
+ - name : Create GitHub Release
96
+ run : gh release create ${{ github.ref_name }} packages/*nupkg
97
+ env :
98
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
99
+
85
100
nuget :
86
101
name : Deploy to NuGet
87
- needs : [build-windows, build-linux ]
102
+ needs : [release ]
88
103
if : startsWith(github.ref, 'refs/tags/v')
89
104
runs-on : ubuntu-24.04
90
105
steps :
91
106
- name : Download artifacts
92
107
uses : actions/download-artifact@v4
93
108
with :
94
- name : nupkgs
109
+ name : packages
95
110
- name : Push to NuGet
96
111
run : |
97
- dotnet nuget push "**/* .nupkg" \
112
+ dotnet nuget push "*.nupkg" \
98
113
-k ${{ secrets.NUGET_KEY }} \
99
114
-s https://api.nuget.org/v3/index.json
0 commit comments