mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
No build metadata allowed in pypi versions
This commit is contained in:
20
.github/set-nbgv-version.ps1
vendored
20
.github/set-nbgv-version.ps1
vendored
@@ -1,17 +1,20 @@
|
||||
param(
|
||||
[string]$version = $(nbgv get-version -v NuGetPackageVersion).Trim()
|
||||
)
|
||||
# param(
|
||||
# [string]$nuGetPackageVersion = $(nbgv get-version -v NuGetPackageVersion).Trim()
|
||||
# )
|
||||
|
||||
$semverVersion = $(nbgv get-version -v NuGetPackageVersion).Trim()
|
||||
$fourpartVersion = $(nbgv get-version -v Version).Trim()
|
||||
|
||||
$originalLocation = Get-Location
|
||||
|
||||
# setting cargo workspace version
|
||||
$scriptDir = "$PSScriptRoot/.."
|
||||
$path = Join-Path $scriptDir "Cargo.toml"
|
||||
Write-Host "Setting version to $version"
|
||||
Write-Host "Setting version to $semverVersion"
|
||||
|
||||
(Get-Content $path) | ForEach-Object {
|
||||
if ($_ -match '^version\s*=\s*".*"') {
|
||||
$_ -replace '^version\s*=\s*".*"', "version = `"$version`""
|
||||
$_ -replace '^version\s*=\s*".*"', "version = `"$semverVersion`""
|
||||
}
|
||||
else {
|
||||
$_
|
||||
@@ -20,15 +23,16 @@ Write-Host "Setting version to $version"
|
||||
|
||||
# setting nodejs version
|
||||
Set-Location "$scriptDir/src/lib-nodejs"
|
||||
npm version $version --no-git-tag-version
|
||||
npm version $semverVersion --no-git-tag-version
|
||||
|
||||
# setting pyproject.toml version
|
||||
$pyprojectPath = [IO.Path]::Combine($scriptDir, 'src', 'lib-python', 'pyproject.toml')
|
||||
|
||||
$pythonVersion = $version
|
||||
$pythonVersion = $semverVersion
|
||||
if ($pythonVersion -match '-g') {
|
||||
$pythonVersion = $pythonVersion -replace '-g', '.dev+'
|
||||
$pythonVersion = $fourpartVersion -replace '^(\d+\.\d+\.\d+)\.(\d+)$', '${1}.dev${2}'
|
||||
}
|
||||
Write-Host "Python version to $pythonVersion"
|
||||
|
||||
(Get-Content $pyprojectPath) | ForEach-Object {
|
||||
if ($_ -match '^version\s*=\s*".*"') {
|
||||
|
||||
Reference in New Issue
Block a user