diff --git a/.appveyor/moveTagForSpecialBranches.ps1 b/.appveyor/moveTagForSpecialBranches.ps1 new file mode 100644 index 00000000..88ce7aeb --- /dev/null +++ b/.appveyor/moveTagForSpecialBranches.ps1 @@ -0,0 +1,17 @@ +$Env:NIGHTLY_BUILD = false +if($Env:APPVEYOR_REPO_TAG -ne "true") { + if($Env:APPVEYOR_REPO_BRANCH -eq "appveyorTest"){ + $targetTag = "Nightly" + $Env:NIGHTLY_BUILD = true + } + else{ + Write-Host "No tag or special branch found" + Return + } + git config --global user.email "build@vocaluxe.de"; + git config --global user.name "Vocaluxe_Automatic_Build"; + git tag "$targetTag" -f; + git push -q -f "https://$($Env:GitHubKey):x-oauth-basic@github.com/lukeIam/Vocaluxe.git" "$targetTag"; + + Write-Host "Branch $Env:APPVEYOR_REPO_BRANCH -> Tag=$targetTag" +} \ No newline at end of file diff --git a/.appveyor/prepareDeploy.ps1 b/.appveyor/prepareDeploy.ps1 index c6bbbd82..9706988f 100644 --- a/.appveyor/prepareDeploy.ps1 +++ b/.appveyor/prepareDeploy.ps1 @@ -3,19 +3,7 @@ if($Env:APPVEYOR_REPO_TAG -eq "true") { Write-Host "Tag=$targetTag" } else{ - if($Env:APPVEYOR_REPO_BRANCH -eq "appveyorTest"){ - $targetTag = "Nightly" - } - else{ - Write-Host "No tag or special branch found" - Return - } - git config --global user.email "build@vocaluxe.de"; - git config --global user.name "Vocaluxe_Automatic_Build"; - git tag "$targetTag" -f; - git push -q -f "https://$($Env:GitHubKey):x-oauth-basic@github.com/lukeIam/Vocaluxe.git" "$targetTag"; - - Write-Host "Branch $Env:APPVEYOR_REPO_BRANCH -> Tag=$targetTag" + Return; } $getRelaseInfoParams = @{ @@ -31,15 +19,15 @@ catch [System.Net.WebException] $statusCode = [int]$_.Exception.Response.StatusCode $html = $_.Exception.Response.StatusDescription Write-Host "No Release found for this tag ($html)" - Return + Return; } -$assetId = ($result.assets | where {$_.name -EQ "Vocaluxe_$Env:APPVEYOR_REPO_BRANCH_Windows_$Env:PLATFORM.zip" } | Select-Object -first 1 ).id +$assetId = ($result.assets | where {$_.name -EQ "Vocaluxe_$Env:APPVEYOR_REPO_TAG_NAME_Windows_$Env:PLATFORM.zip" } | Select-Object -first 1 ).id if(!$assetId){ # No matching asset found in this release - Write-Host "No matching asset found in this release" - Return + Write-Host "No matching asset found in this release: Vocaluxe_$Env:APPVEYOR_REPO_TAG_NAME_Windows_$Env:PLATFORM.zip" + Return; } $deleteAssetParams = @{ @@ -60,6 +48,6 @@ catch [System.Net.WebException] $statusCode = [int]$_.Exception.Response.StatusCode $html = $_.Exception.Response.StatusDescription Write-Host "Could not delete asset ($html)" - Return + Return; } \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index b51c56eb..eabc541e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,6 +19,9 @@ install: ./.appveyor/gitDescribe.ps1 $Env:GIT_VERSION_TAG = $Env:VersionTag + + + ./.appveyor/moveTagForSpecialBranches.ps1 before_build: - ps: >- nuget restore -DisableParallelProcessing @@ -45,7 +48,7 @@ before_deploy: deploy: - provider: GitHub tag: $(APPVEYOR_REPO_TAG_NAME) - release: $(APPVEYOR_REPO_TAG_NAME) ({APPVEYOR_REPO_COMMIT_TIMESTAMP}) + release: $(APPVEYOR_REPO_TAG_NAME) ($(APPVEYOR_REPO_COMMIT_TIMESTAMP)) description: 'Version: {GIT_VERSION_TAG}' auth_token: secure: QBwVoI9PlI+PWfX8vtjH22cSPhj2nwJ78CQcwC4Olsibn1QNar2KX4HEfOGNbazA @@ -53,13 +56,14 @@ deploy: prerelease: true on: APPVEYOR_REPO_TAG: true + NIGHTLY_BUILD: false - provider: GitHub - tag: Nightly - release: Current Nightly ({APPVEYOR_REPO_COMMIT_TIMESTAMP}) + tag: $(APPVEYOR_REPO_TAG_NAME) + release: Latest Nightly build ($(APPVEYOR_REPO_COMMIT_TIMESTAMP)) description: 'Version: {GIT_VERSION_TAG}' auth_token: secure: QBwVoI9PlI+PWfX8vtjH22cSPhj2nwJ78CQcwC4Olsibn1QNar2KX4HEfOGNbazA artifact: ReleaseZip on: - branch: appveyorTest - APPVEYOR_PULL_REQUEST_NUMBER: '' \ No newline at end of file + APPVEYOR_REPO_TAG: true + NIGHTLY_BUILD: true \ No newline at end of file