From e8dbc7babbc848b803fcd7a95d1ccec0eb5acf80 Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Sun, 15 Oct 2023 03:56:07 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84Version=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 11 +++++++---- .github/workflows/smoke-testing.yml | 16 +--------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 444c6cc922..1d998c75ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,12 +119,15 @@ jobs: run: | $csprojPath = "src/MaaWpfGui/MaaWpfGui.csproj" $csprojPath = Resolve-Path -Path $csprojPath + $tag = (Invoke-Expression "git describe --abbrev=0 --tags") -replace '.*?/', '' + $tag -match '\d+(\.\d+){0,3}' + $match = $Matches[0] [xml]$csproj = Get-Content -Path $csprojPath $node = $csproj.Project.PropertyGroup | where {$_.AssemblyName -ne $null} - $node.InformationalVersion = '${{ needs.meta.outputs.tag }}' - $node.Version = '${{ needs.meta.outputs.tag }}' - $node.FileVersion = '${{ needs.meta.outputs.tag }}' - $node.AssemblyVersion = '${{ needs.meta.outputs.tag }}' + $node.InformationalVersion = $tag + $node.Version = $match + $node.FileVersion = $match + $node.AssemblyVersion = $match $csproj.Save($csprojPath) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/smoke-testing.yml b/.github/workflows/smoke-testing.yml index 9fae11a7f6..366bdb5c0b 100644 --- a/.github/workflows/smoke-testing.yml +++ b/.github/workflows/smoke-testing.yml @@ -28,21 +28,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - - name: Taggify Version - run: | - $csprojPath = "src/MaaWpfGui/MaaWpfGui.csproj" - $csprojPath = Resolve-Path -Path $csprojPath - [xml]$csproj = Get-Content -Path $csprojPath - $node = $csproj.Project.PropertyGroup | where {$_.AssemblyName -ne $null} - $node.InformationalVersion = '${{ needs.meta.outputs.tag }}' - $node.Version = '${{ needs.meta.outputs.tag }}' - $node.FileVersion = '${{ needs.meta.outputs.tag }}' - $node.AssemblyVersion = '${{ needs.meta.outputs.tag }}' - $csproj.Save($csprojPath) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - uses: NuGet/setup-nuget@v1.2.0 - run: | nuget restore MAA.sln