From bc21621d9ac1549a12e02854797be7a4234cd400 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 23 Dec 2024 16:50:06 +0100 Subject: [PATCH] add release script --- release.ps1 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 release.ps1 diff --git a/release.ps1 b/release.ps1 new file mode 100644 index 000000000..8863a1214 --- /dev/null +++ b/release.ps1 @@ -0,0 +1,31 @@ +param( + [string]$VersionString +) + +if (-not $VersionString) { + Write-Error "Version string is required as the first argument." + exit 1 +} + +$csprojPath = "Dalamud/Dalamud.csproj" + +if (-not (Test-Path $csprojPath)) { + Write-Error "Cannot find Dalamud.csproj at the specified path." + exit 1 +} + +# Update the version in the csproj file +(Get-Content $csprojPath) -replace '.*?', "$VersionString" | Set-Content $csprojPath + +# Commit the change +git add $csprojPath +git commit -m "build: $VersionString" + +# Get the current branch +$currentBranch = git rev-parse --abbrev-ref HEAD + +# Create a tag +git tag -a -m "v$VersionString" $VersionString + +# Push atomically +git push origin $currentBranch $VersionString \ No newline at end of file