mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Automatically set default masterlist branches on release
This commit is contained in:
@@ -110,6 +110,7 @@ deploy:
|
||||
|
||||
on_success:
|
||||
- ps: scripts\appveyor\delete_old_artifacts.ps1
|
||||
- ps: scripts\appveyor\update_masterlist_branches.ps1
|
||||
|
||||
on_finish:
|
||||
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:CONFIGURATION)\tests.xml")
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
function Get-BranchName() {
|
||||
$numbers = $env:APPVEYOR_REPO_TAG_NAME.Split('.')
|
||||
|
||||
if ($numbers[0] -eq 0) {
|
||||
$numbers = $numbers[0..($numbers.length - 2)]
|
||||
} else {
|
||||
$numbers = @($numbers[0])
|
||||
}
|
||||
|
||||
return "v" + ($numbers -join '.')
|
||||
}
|
||||
|
||||
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
|
||||
npm install -g lomad
|
||||
$branchName = Get-BranchName
|
||||
|
||||
Write-Output "`nUpdating masterlists' default branch to $branchName..."
|
||||
lomad -t $env:access_token -a -d $branchName
|
||||
|
||||
if ($lastexitcode -eq 0) {
|
||||
Write-Output "Masterlists' default branches have been updated."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user