mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-11 01:37:24 +01:00
add release script
This commit is contained in:
parent
c647d07d94
commit
bc21621d9a
1 changed files with 31 additions and 0 deletions
31
release.ps1
Normal file
31
release.ps1
Normal file
|
|
@ -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 '<DalamudVersion>.*?</DalamudVersion>', "<DalamudVersion>$VersionString</DalamudVersion>" | 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue