From 714389681a6647a358caa82a0a810d4a93a8e996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 18 Oct 2018 15:23:38 +0100 Subject: [PATCH] Fix issues with AppVeyor yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Simões --- appveyor.yml | 18 ++++++++++++------ commit-assemblyinfo-changes.ps1 | 2 +- install-vsix-appveyor.ps1 | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ced2ca5b..77d8a99e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,7 @@ init: - ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GitHubToken):x-oauth-basic@github.com`n" - git config --global user.email "%GitHubUserEmail%" - git config --global user.name "%GitHubUserName%" -- ps: "$headers = if($env:APPVEYOR_PULL_REQUEST_NUMBER){\n @{\n \"Authorization\" = \"Basic $env:GitRestAuth\"\n \"Content-type\" = \"application/json\"\n}\n\n$pr = Invoke-RestMethod -Uri \"https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/pulls/$env:APPVEYOR_PULL_REQUEST_NUMBER\" -Headers $headers -Method GET\n\nif($pr.user.login -eq \"nfbot\" -and $pr.body -match \"*[version update]*\")\n{\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n} }\n" +- ps: "$headers = if($env:APPVEYOR_PULL_REQUEST_NUMBER){\n @{\n \"Authorization\" = \"Basic $env:GitRestAuth\"\n \"Content-type\" = \"application/json\"\n}\n\n$pr = Invoke-RestMethod -Uri \"https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/pulls/$env:APPVEYOR_PULL_REQUEST_NUMBER\" -Headers $headers -Method GET\n\nif($pr.user.login -eq \"nfbot\" -and $pr.body -like \"*[version update]*\")\n{\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n} }\n" - ps: "if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq \"\")\n{\n \n if($env:APPVEYOR_REPO_COMMIT_AUTHOR -eq \"nfbot\" -and $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -like \"*[version update]*\")\n {\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n }\n}" install: @@ -66,6 +66,11 @@ before_build: C:\ProgramData\chocolatey\lib\GitVersion.Portable\tools\GitVersion.exe /l console /output buildserver /updateAssemblyInfo "source\nanoFramework.CoreLibrary\System\AssemblyInfo2.cs" +after_deploy: +# for this environment variable to work here it has to be set in AppVeyor UI +- nuget push source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package +- nuget push source\Nuget.CoreLibrary.DELIVERABLES\bin\Release\nanoFramework.CoreLibrary.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package + build_script: - ps: >- @@ -120,6 +125,8 @@ for: draft: true prerelease: false force_update: true + on: + appveyor_repo_tag: false - branches: @@ -137,11 +144,8 @@ for: draft: true prerelease: true force_update: true - - after_deploy: - # for this environment variable to work here it has to be set in AppVeyor UI - - nuget push source\Nuget.CoreLibrary\bin\Release\nanoFramework.CoreLibrary.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package - - nuget push source\Nuget.CoreLibrary.DELIVERABLES\bin\Release\nanoFramework.CoreLibrary.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package + on: + appveyor_repo_tag: false - branches: @@ -164,3 +168,5 @@ for: draft: true prerelease: true force_update: true + on: + appveyor_repo_tag: false diff --git a/commit-assemblyinfo-changes.ps1 b/commit-assemblyinfo-changes.ps1 index c13870f5..8cfedcaf 100644 --- a/commit-assemblyinfo-changes.ps1 +++ b/commit-assemblyinfo-changes.ps1 @@ -7,7 +7,7 @@ else { # updated assembly info files git add "source\nanoFramework.CoreLibrary\System\AssemblyInfo2.cs" - git commit -m "Update assembly info file for v$env:GitVersion_NuGetVersionV2 [skip ci]" -m"[version update]" + git commit -m "Update assembly info file for v$env:GitVersion_NuGetVersionV2" -m"[version update]" git push origin --porcelain -q > $null 'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline diff --git a/install-vsix-appveyor.ps1 b/install-vsix-appveyor.ps1 index dda0f6b2..127c876d 100644 --- a/install-vsix-appveyor.ps1 +++ b/install-vsix-appveyor.ps1 @@ -4,6 +4,6 @@ $vsixPath = "$($env:USERPROFILE)\nanoFramework.Tools.VS2017.Extension.vsix" 'Installing nanoFramework VS extension ...' | Write-Host -ForegroundColor White -NoNewline -& .\install-vsix.cmd --quiet --no-verbose > $null +& .\install-vsix.cmd > $null 'OK' | Write-Host -ForegroundColor Green