-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (59 loc) · 1.85 KB
/
Copy pathrelease.yml
File metadata and controls
74 lines (59 loc) · 1.85 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Publish NuGet
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build
- name: Pack
run: |
VERSION=${GITHUB_REF#refs/tags/v}
dotnet pack \
src/DotEnv.Core.csproj \
-c Release \
--no-build \
-p:Version=$VERSION
dotnet pack \
plugins/Microsoft.Extensions.DI/src/DotEnv.Extensions.Microsoft.DI.csproj \
-c Release \
--no-build \
-p:Version=$VERSION
dotnet pack \
plugins/Microsoft.Extensions.Config/src/DotEnv.Extensions.Microsoft.Configuration.csproj \
-c Release \
--no-build \
-p:Version=$VERSION
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: pochi
- name: Publish
run: |
dotnet nuget push \
src/bin/Release/*.nupkg \
--api-key ${{ steps.login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
dotnet nuget push \
plugins/Microsoft.Extensions.DI/src/bin/Release/*.nupkg \
--api-key ${{ steps.login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
dotnet nuget push \
plugins/Microsoft.Extensions.Config/src/bin/Release/*.nupkg \
--api-key ${{ steps.login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json