2018-04-14 07:05:25 +08:00
|
|
|
if($env:APPVEYOR){
|
|
|
|
git config --global credential.helper store
|
|
|
|
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):x-oauth-basic@github.com`n"
|
|
|
|
git config --global user.email "appveyor@genteure.com"
|
|
|
|
git config --global user.name "Appveyor(Genteure)"
|
|
|
|
git config --global core.autocrlf false
|
|
|
|
}
|
|
|
|
|
|
|
|
$commit_message_version_regex="^Release: (\d+\.\d+\.\d+)$"
|
|
|
|
|
|
|
|
if ($env:APPVEYOR_REPO_BRANCH -eq "dev" -and $env:APPVEYOR_REPO_COMMIT_MESSAGE -cmatch $commit_message_version_regex)
|
|
|
|
{
|
2018-04-14 12:04:04 +08:00
|
|
|
git checkout dev -q
|
2018-04-14 07:05:25 +08:00
|
|
|
$env:BILILIVERECORDER_RELEASE=$true
|
2018-04-14 10:22:45 +08:00
|
|
|
$env:p_version="$($Matches[1]).0"
|
2018-04-14 07:05:25 +08:00
|
|
|
Update-AppveyorBuild -Version "$env:p_version"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$env:BILILIVERECORDER_RELEASE=$false
|
|
|
|
$env:p_version="0.0.0.$env:APPVEYOR_BUILD_NUMBER"
|
|
|
|
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.Substring(0, 7))-$env:APPVEYOR_BUILD_NUMBER"
|
|
|
|
}
|
|
|
|
|
|
|
|
Write-Host "Current build version is $env:p_version"
|