Merge pull request #286 from lukeIam/modBuildScript

Build script adjustments
This commit is contained in:
lukeIam authored and GitHub committed 2017-08-14 20:46:57 +02:00
commit 45c8eb2e9b
3 files changed
+30 -11

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
Write-Host "Deployment finished -> do en empty commit on the gh-pages branch to update the page"
git config --global user.email "noreply@vocaluxe.org"
git config --global user.name "VocaluxeBuildBot"
git checkout "gh-pages"
git reset --hard HEAD
git commit --allow-empty -m "Trigger page update after a new publish (triggered by $Env:APPVEYOR_REPO_COMMIT_MESSAGE ($Env:APPVEYOR_REPO_COMMIT))"
git push -q "https://$($Env:GitHubKey):x-oauth-basic@github.com/Vocaluxe/Vocaluxe.git" "gh-pages"
git checkout -
+17 -9
View File
@@ -7,6 +7,8 @@ else{
Return; Return;
} }
$Env:IS_BETA_RELEASE = ($Env:APPVEYOR_REPO_TAG_NAME -match "beta")
$getRelaseInfoParams = @{ $getRelaseInfoParams = @{
Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/tags/$targetTag"; Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/tags/$targetTag";
Method = 'GET'; Method = 'GET';
@@ -23,20 +25,26 @@ catch [System.Net.WebException]
# No Release found for this tag # No Release found for this tag
$statusCode = [int]$_.Exception.Response.StatusCode $statusCode = [int]$_.Exception.Response.StatusCode
$html = $_.Exception.Response.StatusDescription $html = $_.Exception.Response.StatusDescription
Write-Host "No Release found for this tag ($html): $($Env:APPVEYOR_REPO_TAG_NAME)" Write-Host "No Release found for this tag ($html): $targetTag"
Return; Return;
} }
$assetId = ($result.assets | where {$_.name -EQ "Vocaluxe_$($Env:APPVEYOR_REPO_TAG_NAME)_Windows_$($Env:PLATFORM).zip" } | Select-Object -first 1 ).id $releaseId = $result.id
if(!$assetId){ if(!$releaseId){
# No matching asset found in this release # No matching release found in this release
Write-Host "No matching asset found in this release: Vocaluxe_$($Env:APPVEYOR_REPO_TAG_NAME)_Windows_$($Env:PLATFORM).zip" Write-Host "No matching release found"
Return;
}
if($result.body -match $Env:APPVEYOR_REPO_COMMIT){
# An other build already recreated the release
Write-Host "An other build already recreated the release"
Return; Return;
} }
$deleteAssetParams = @{ $deleteAssetParams = @{
Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/assets/$assetId"; Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/$releaseId";
Method = 'DELETE'; Method = 'DELETE';
Headers = @{ Headers = @{
Authorization = 'Basic ' + [Convert]::ToBase64String( Authorization = 'Basic ' + [Convert]::ToBase64String(
@@ -45,14 +53,14 @@ $deleteAssetParams = @{
} }
try{ try{
$result = Invoke-RestMethod @deleteAssetParams $result = Invoke-RestMethod @deleteAssetParams
Write-Host "Successfully deleted asset: Vocaluxe_$($Env:APPVEYOR_REPO_TAG_NAME)_Windows_$($Env:PLATFORM).zip" Write-Host "Successfully deleted release for: $targetTag"
} }
catch [System.Net.WebException] catch [System.Net.WebException]
{ {
# Could not delete asset # Could not delete release
$statusCode = [int]$_.Exception.Response.StatusCode $statusCode = [int]$_.Exception.Response.StatusCode
$html = $_.Exception.Response.StatusDescription $html = $_.Exception.Response.StatusDescription
Write-Host "Could not delete asset ($html): Vocaluxe_$($Env:APPVEYOR_REPO_TAG_NAME)_Windows_$($Env:PLATFORM).zip" Write-Host "Could not delete release ($html) for: $targetTag"
Return; Return;
} }
+5 -2
View File
@@ -80,6 +80,8 @@ after_build:
test: off test: off
before_deploy: before_deploy:
- ps: ./.appveyor/prepareDeploy.ps1 - ps: ./.appveyor/prepareDeploy.ps1
after_deploy:
- ps: ./.appveyor/afterDeploy.ps1
deploy: deploy:
- provider: GitHub - provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME) tag: $(APPVEYOR_REPO_TAG_NAME)
@@ -88,7 +90,7 @@ deploy:
auth_token: auth_token:
secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW
artifact: ReleaseZip artifact: ReleaseZip
prerelease: true prerelease: $(IS_BETA_RELEASE)
on: on:
APPVEYOR_REPO_TAG: true APPVEYOR_REPO_TAG: true
NIGHTLY_BUILD: false NIGHTLY_BUILD: false
@@ -96,10 +98,11 @@ deploy:
- provider: GitHub - provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME) tag: $(APPVEYOR_REPO_TAG_NAME)
release: Latest Nightly build release: Latest Nightly build
description: description: $(APPVEYOR_REPO_COMMIT)
auth_token: auth_token:
secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW
artifact: ReleaseZip artifact: ReleaseZip
prerelease: true
on: on:
APPVEYOR_REPO_TAG: true APPVEYOR_REPO_TAG: true
NIGHTLY_BUILD: true NIGHTLY_BUILD: true