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;
}
$Env:IS_BETA_RELEASE = ($Env:APPVEYOR_REPO_TAG_NAME -match "beta")
$getRelaseInfoParams = @{
Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/tags/$targetTag";
Method = 'GET';
@@ -23,20 +25,26 @@ catch [System.Net.WebException]
# No Release found for this tag
$statusCode = [int]$_.Exception.Response.StatusCode
$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;
}
$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){
# No matching asset found in this release
Write-Host "No matching asset found in this release: Vocaluxe_$($Env:APPVEYOR_REPO_TAG_NAME)_Windows_$($Env:PLATFORM).zip"
if(!$releaseId){
# No matching release found in this release
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;
}
$deleteAssetParams = @{
Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/assets/$assetId";
Uri = "https://api.github.com/repos/Vocaluxe/Vocaluxe/releases/$releaseId";
Method = 'DELETE';
Headers = @{
Authorization = 'Basic ' + [Convert]::ToBase64String(
@@ -45,14 +53,14 @@ $deleteAssetParams = @{
}
try{
$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]
{
# Could not delete asset
# Could not delete release
$statusCode = [int]$_.Exception.Response.StatusCode
$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;
}
+5 -2
View File
@@ -80,6 +80,8 @@ after_build:
test: off
before_deploy:
- ps: ./.appveyor/prepareDeploy.ps1
after_deploy:
- ps: ./.appveyor/afterDeploy.ps1
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
@@ -88,7 +90,7 @@ deploy:
auth_token:
secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW
artifact: ReleaseZip
prerelease: true
prerelease: $(IS_BETA_RELEASE)
on:
APPVEYOR_REPO_TAG: true
NIGHTLY_BUILD: false
@@ -96,10 +98,11 @@ deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
release: Latest Nightly build
description:
description: $(APPVEYOR_REPO_COMMIT)
auth_token:
secure: JSlN/em0JdspVn8jwaQ4IjugY6OQi0au4Qq0rhctJmcfGMaEGnUAOmDFULI48REW
artifact: ReleaseZip
prerelease: true
on:
APPVEYOR_REPO_TAG: true
NIGHTLY_BUILD: true