From 6885de7a4d59581d006072ee9c427ec37d7d15cf Mon Sep 17 00:00:00 2001 From: BiDuang Date: Wed, 10 Jul 2024 11:14:52 +0800 Subject: [PATCH 1/2] ci: Update pre-release version id control --- .github/workflows/pre-release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index acd1a4e..ee6d5d7 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,6 +1,6 @@ name: Publish Pre-Release Version NuGet Package -on: +on: push: branches: [master] jobs: @@ -36,11 +36,16 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@v1" with: fallback: 1.0.0 + - name: Get current datetime + id: currentdatetime + uses: Kaven-Universe/github-action-current-date-time@v1 + with: + format: "yyyyMMddHHmmss" - name: Restore packages run: dotnet restore ProjBobcat/ProjBobcat/ProjBobcat.csproj - name: Build the project run: dotnet build ProjBobcat/ProjBobcat/ProjBobcat.csproj -c Release --no-restore - name: Create the package - run: $tag="${{ steps.previoustag.outputs.tag }}".replace("v",""); dotnet pack ProjBobcat/ProjBobcat/ProjBobcat.csproj -c Release -p:PackageVersion="$tag-CI${{ github.sha }}-beta" --no-build --no-restore -o . + run: $tag="${{ steps.previoustag.outputs.tag }}".replace("v",""); dotnet pack ProjBobcat/ProjBobcat/ProjBobcat.csproj -c Release -p:PackageVersion="$tag-CI${{ steps.currentdatetime.outputs.time }}-beta" --no-build --no-restore -o . - name: Publish the package to NuGet.org run: dotnet nuget push *.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json From 56d55a7d4c2633091382553f34d8f0cd5ff59bee Mon Sep 17 00:00:00 2001 From: BiDuang Date: Wed, 10 Jul 2024 11:20:26 +0800 Subject: [PATCH 2/2] Fix: CI time config --- .github/workflows/pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index ee6d5d7..7cd9576 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -40,7 +40,7 @@ jobs: id: currentdatetime uses: Kaven-Universe/github-action-current-date-time@v1 with: - format: "yyyyMMddHHmmss" + format: "YYYYMMDDHHmmssSSS" - name: Restore packages run: dotnet restore ProjBobcat/ProjBobcat/ProjBobcat.csproj - name: Build the project