-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (42 loc) · 1.19 KB
/
package.yml
File metadata and controls
51 lines (42 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build & Release .NET Package
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Publish
run: |
version=$(git describe --tags --abbrev=0)
projects=("BangumiNet.Api"
"BangumiNet.Common"
"BangumiNet.Archive"
"BangumiNet.BangumiData")
for project in "${projects[@]}"; do
dotnet pack $project -p:Version=${version#v} -c Release -o .
done
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: pkg-archive
path: BangumiNet.*nupkg
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: pkg-archive
path: .
- name: Push
run: |
find . -name "*.nupkg" | while read -r pkg; do
dotnet nuget push $pkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
done