Skip to content

Commit

Permalink
尝试对接推送 Tag 打包
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Aug 26, 2024
1 parent 5052077 commit 4a668e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/nuget_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore

- name: Install dotnet tool
run: dotnet tool update -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ github.ref }}

- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Build solution and generate NuGet package
run: dotnet pack -c Release -o ./bin/Release/
run: dotnet build -c Release
- name: Generate NuGet package
run: dotnet pack -c Release --no-build -o ./bin/Release/
- name: Publish to NuGet
run: dotnet nuget push ./bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json"
6 changes: 6 additions & 0 deletions Build/Version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- 此版本号将被推 Tag 打包时覆盖,仅本地构建有用 -->
<Version>99.99.99</Version>
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project>
<PropertyGroup>
<Version>0.1.0-alpha08</Version>
<Company>dotnet campus</Company>
<Authors>SeWzc</Authors>
<Copyright>Copyright (c) dotnet-campus 2023-$([System.DateTime]::Now.ToString(`yyyy`))</Copyright>
Expand Down

0 comments on commit 4a668e0

Please sign in to comment.