chore: 简化版本字符串提取

使用了正则表达式的正向先行断言
This commit is contained in:
Xu 2025-12-02 17:56:23 +08:00
commit 678ff1d9e4

View file

@ -49,10 +49,7 @@ jobs:
- name: Build
run: |
$versionString =
if ("${{ steps.tag.outputs.tag }}" -eq "") { "" }
elseif ("${{ steps.tag.outputs.tag }}" -match '^v\d') { "${{ steps.tag.outputs.tag }}".Substring(1) }
else { "${{ steps.tag.outputs.tag }}" }
$versionString = "${{ steps.tag.outputs.tag }}" -replace "^v(?=\d)", ""
python scripts/publish.py --compiler=ClangCL --platform=${{ matrix.platform }} --version-major=${{ inputs.major }} --version-minor=${{ inputs.minor }} --version-patch=${{ inputs.patch }} --version-string=$versionString --pfx-path=certs\Magpie.pfx --pfx-password="${{ secrets.MAGPIE_PFX_PASSWORD }}"
- name: Store artifacts