From 4a668e03b11239fe5b1d5076ad17021be69c2a92 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 26 Aug 2024 14:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=AF=B9=E6=8E=A5=E6=8E=A8?= =?UTF-8?q?=E9=80=81=20Tag=20=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/nuget_publish.yml | 16 +++++++++------- Build/Version.props | 6 ++++++ Directory.Build.props | 1 - 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 Build/Version.props diff --git a/.github/workflows/nuget_publish.yml b/.github/workflows/nuget_publish.yml index 26104e7..f20a8bf 100644 --- a/.github/workflows/nuget_publish.yml +++ b/.github/workflows/nuget_publish.yml @@ -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" \ No newline at end of file diff --git a/Build/Version.props b/Build/Version.props new file mode 100644 index 0000000..2d69842 --- /dev/null +++ b/Build/Version.props @@ -0,0 +1,6 @@ + + + + 99.99.99 + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 5b88b31..1b0ae83 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,5 @@ - 0.1.0-alpha08 dotnet campus SeWzc Copyright (c) dotnet-campus 2023-$([System.DateTime]::Now.ToString(`yyyy`))