CI: Versionsnummer wird bei jedem Versions-Tag automatisch in tauri.conf.json, package.json und Cargo.toml gesetzt
All checks were successful
Windows Installer bauen / build-windows (push) Successful in 7m52s
All checks were successful
Windows Installer bauen / build-windows (push) Successful in 7m52s
This commit is contained in:
parent
f2cf99a724
commit
74a8517f4f
1 changed files with 29 additions and 0 deletions
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
|
|
@ -139,6 +139,35 @@ jobs:
|
||||||
$changelog = "changelog<<CHANGELOG_EOF`n$($log -join "`n")`nCHANGELOG_EOF"
|
$changelog = "changelog<<CHANGELOG_EOF`n$($log -join "`n")`nCHANGELOG_EOF"
|
||||||
Add-Content -Path $env:GITHUB_OUTPUT -Value $changelog
|
Add-Content -Path $env:GITHUB_OUTPUT -Value $changelog
|
||||||
|
|
||||||
|
- name: Versionsnummer aus Tag automatisch setzen (nur bei Versions-Tag)
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
working-directory: tauri-app
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$version = "${{ github.ref_name }}" -replace '^v', ''
|
||||||
|
Write-Host "Setze Version auf $version in tauri.conf.json, package.json, Cargo.toml ..."
|
||||||
|
|
||||||
|
$confPath = "src-tauri/tauri.conf.json"
|
||||||
|
$content = Get-Content $confPath -Raw
|
||||||
|
$neu = $content -replace '("version"\s*:\s*)"[^"]*"', "`$1`"$version`""
|
||||||
|
if ($neu -eq $content) { Write-Error "Version in $confPath nicht gefunden/ersetzt." }
|
||||||
|
Set-Content -Path $confPath -Value $neu -NoNewline
|
||||||
|
|
||||||
|
$pkgPath = "package.json"
|
||||||
|
$content = Get-Content $pkgPath -Raw
|
||||||
|
$neu = $content -replace '("version"\s*:\s*)"[^"]*"', "`$1`"$version`""
|
||||||
|
if ($neu -eq $content) { Write-Error "Version in $pkgPath nicht gefunden/ersetzt." }
|
||||||
|
Set-Content -Path $pkgPath -Value $neu -NoNewline
|
||||||
|
|
||||||
|
$cargoPath = "src-tauri/Cargo.toml"
|
||||||
|
$content = Get-Content $cargoPath -Raw
|
||||||
|
$neu = $content -replace '(?m)^version = "[^"]*"', "version = `"$version`""
|
||||||
|
if ($neu -eq $content) { Write-Error "Version in $cargoPath nicht gefunden/ersetzt." }
|
||||||
|
Set-Content -Path $cargoPath -Value $neu -NoNewline
|
||||||
|
|
||||||
|
Write-Host " Erledigt, alle drei Dateien jetzt auf $version."
|
||||||
|
|
||||||
- name: Bauen und signieren (nur bei Versions-Tag)
|
- name: Bauen und signieren (nur bei Versions-Tag)
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
working-directory: tauri-app
|
working-directory: tauri-app
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue