Skip to content

Commit 27c6427

Browse files
committed
Replaced nuget publishing script
1 parent 01dce46 commit 27c6427

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

.github/workflows/nuget.yml renamed to .github/workflows/release.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
name: Publish to NuGet
1+
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
8-
env:
9-
NuGetDirectory: ${{ github.workspace}}/nuget
4+
release:
5+
types: [published]
6+
tags:
7+
- "[0-9]+.[0-9]+.[0-9]+"
8+
- "[0-9]+.[0-9]+.[0-9]+-*"
109

1110
jobs:
1211
build-and-publish:
@@ -28,10 +27,9 @@ jobs:
2827

2928
- name: Test
3029
run: dotnet test --no-restore --verbosity normal
31-
30+
3231
- name: Pack projects
33-
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
32+
run: dotnet pack --no-build -c Release -o nupkg /p:PackageVersion=${{ github.event.release.tag_name }}
3433

35-
- name: Publish to NuGet.org
36-
run: |
37-
nuget push ${{ env.NuGetDirectory }}/ToolBX.Eloquentest.*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} -SkipDuplicate
34+
- name: Publish to NuGet
35+
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

Eloquentest.Sample/Eloquentest.Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="ToolBX.AutoInject" Version="2.2.0-beta6" />
10+
<PackageReference Include="ToolBX.AutoInject" Version="2.2.0-beta7" />
1111
<PackageReference Include="ToolBX.NetAbstractions" Version="2.2.0-beta1" />
1212
</ItemGroup>
1313

Eloquentest/Eloquentest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
3535
<PackageReference Include="Moq" Version="4.20.70" />
3636
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
37-
<PackageReference Include="ToolBX.AutoInject" Version="2.2.0-beta6" />
38-
<PackageReference Include="ToolBX.Reflection4Humans.ValueEquality" Version="2.2.0-beta8" />
37+
<PackageReference Include="ToolBX.AutoInject" Version="2.2.0-beta7" />
38+
<PackageReference Include="ToolBX.Reflection4Humans.ValueEquality" Version="2.2.0-beta9" />
3939
</ItemGroup>
4040

4141
</Project>

0 commit comments

Comments
 (0)