File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 6
6
branches : [main]
7
7
workflow_dispatch : {} # Allow manual trigger
8
8
workflow_call : {} # Allow triggering from other worfkflows
9
+ release :
10
+ types : [published]
9
11
10
12
permissions :
11
13
packages : write
@@ -195,19 +197,29 @@ jobs:
195
197
196
198
publish-package :
197
199
needs : build-package
198
- if : github.ref == 'refs/heads/main'
200
+ if : github.ref == 'refs/heads/main' || github.event_name == 'release'
199
201
runs-on : ubuntu-latest
200
202
steps :
201
203
- name : Checkout code
202
204
uses : actions/checkout@v2
203
205
- name : Setup Dotnet
204
206
uses : actions/setup-dotnet@v4
205
- - name : download nightly package
207
+ - name : Download nightly package
206
208
uses : actions/download-artifact@v4
207
209
with :
208
210
name : nuget_package_nightly
209
211
path : artifacts/package/nightly
212
+ - name : Download release package
213
+ if : github.event_name == 'release'
214
+ uses : actions/download-artifact@v4
215
+ with :
216
+ name : nuget_package_release
217
+ path : artifacts/package/release
210
218
- name : List artifacts
211
219
run : ls -R artifacts/
212
220
- name : Publish nightly to GitHub Packages
213
221
run : dotnet nuget push artifacts/package/nightly/*.nupkg --source "https://nuget.pkg.github.com/LittleLittleCloud/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
222
+
223
+ - name : Publish release to NuGet
224
+ if : github.event_name == 'release'
225
+ run : dotnet nuget push artifacts/package/release/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
You can’t perform that action at this time.
0 commit comments