forked from goatcorp/Dalamud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.ps1
More file actions
31 lines (23 loc) · 776 Bytes
/
Copy pathrelease.ps1
File metadata and controls
31 lines (23 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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