Skip to content

Commit 11e8d44

Browse files
update piepline
1 parent 06ecb93 commit 11e8d44

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/build.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches: [main]
77
workflow_dispatch: {} # Allow manual trigger
88
workflow_call: {} # Allow triggering from other worfkflows
9+
release:
10+
types: [published]
911

1012
permissions:
1113
packages: write
@@ -195,19 +197,29 @@ jobs:
195197
196198
publish-package:
197199
needs: build-package
198-
if: github.ref == 'refs/heads/main'
200+
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
199201
runs-on: ubuntu-latest
200202
steps:
201203
- name: Checkout code
202204
uses: actions/checkout@v2
203205
- name: Setup Dotnet
204206
uses: actions/setup-dotnet@v4
205-
- name: download nightly package
207+
- name: Download nightly package
206208
uses: actions/download-artifact@v4
207209
with:
208210
name: nuget_package_nightly
209211
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
210218
- name: List artifacts
211219
run: ls -R artifacts/
212220
- name: Publish nightly to GitHub Packages
213221
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

0 commit comments

Comments
 (0)