Skip to content

Commit

Permalink
ci: Update version in project via bump-version script (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
limbonaut authored Jan 30, 2025
1 parent cad80ee commit e93cc99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="Sentry demo project"
config/version="0.1.0"
config/version="0.1.0-dev"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.3")

Expand Down
15 changes: 13 additions & 2 deletions scripts/bump-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@ $content = Get-Content $sconsFile
$content -replace 'VERSION = ".*"', ('VERSION = "' + $newVersion + '"') | Out-File $sconsFile

# Check that the version was updated.
if ("$content" -eq "$(Get-Content $sconsFile)")
{
if ("$content" -eq "$(Get-Content $sconsFile)") {
$versionInFile = [regex]::Match("$content", 'VERSION = "([^"]+)"').Groups[1].Value
if ("$versionInFile" -ne "$newVersion")
{
Throw "Failed to update version in $sconsFile - the content didn't change. The version found in the file is '$versionInFile'."
}
}

$projectFile = "$PSScriptRoot/../project/project.godot"
$projectContent = Get-Content $projectFile
$projectContent -replace 'config/version=".*"', ('config/version="' + $newVersion + '"') | Out-File $projectFile

if ("$projectContent" -eq "$(Get-Content $projectFile)") {
$versionInFile = [regex]::Match("$projectContent", 'config/version="([^"]+)"').Groups[1].Value
if ("$versionInFile" -ne "$newVersion")
{
Throw "Failed to update version in $projectFile - the content didn't change. The version found in the file is '$versionInFile'."
}
}

0 comments on commit e93cc99

Please sign in to comment.