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