Skip to content

Commit c9955bd

Browse files
committed
Improve handling of AppVeyor build
1 parent cc452e2 commit c9955bd

File tree

4 files changed

+71
-79
lines changed

4 files changed

+71
-79
lines changed

appveyor.cmd

Lines changed: 0 additions & 18 deletions
This file was deleted.

appveyor.yml

Lines changed: 36 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,36 @@
1-
- # Development branches build.
2-
version: 0.0.0.{branch}-{build}
3-
configuration: Debug
4-
5-
environment:
6-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
7-
NUGET_XMLDOC_MODE: skip
8-
9-
init:
10-
- git config --global core.autocrlf true
11-
12-
build_script:
13-
- appveyor.cmd
14-
15-
skip_tags: true
16-
17-
18-
- # Master build and deploy.
19-
branches:
20-
only:
21-
- master
22-
23-
version: 0.0.0.{build}
24-
configuration: Release
25-
26-
environment:
27-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
28-
NUGET_XMLDOC_MODE: skip
29-
GITHUB_ACCESS_TOKEN:
30-
secure: BuuXJ8z8dMoeeMPy4l7QbbNPFn1/CW9PRGZxMhH3IAFdtTftFKZHA7eqpBqiE2T3
31-
32-
init:
33-
- git config --global core.autocrlf true
34-
35-
build_script:
36-
- appveyor.cmd
37-
38-
artifacts:
39-
- path: build\deploy\
40-
name: deploy-artifacts
41-
42-
deploy:
43-
- provider: WebDeploy
44-
server: https://wixtoolset-staging.scm.azurewebsites.net:443/msdeploy.axd?site=wixtoolset-staging
45-
website: wixtoolset__staging
46-
username: $wixtoolset__staging
47-
password:
48-
secure: rSNrD+nlS813sckRsk5os/7NiYbvGl9faU3n1KjeCWr8iiO2lHTZTDj/NH9h3zfbagqXPAcu/f5hVjZuBqc95g==
49-
remove_files: true
50-
app_offline: true
51-
artifact: deploy-artifacts
52-
53-
on_success:
54-
- git config --global credential.helper store
55-
- ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GITHUB_ACCESS_TOKEN):[email protected]`n"
56-
- git config --global user.email "[email protected]"
57-
- git config --global user.name "WiX-BoT"
58-
- git tag -a v%GitBuildVersion% -m "Build v%GitBuildVersion%"
59-
- git push --tags origin HEAD:master
60-
61-
skip_tags: true
1+
version: 0.0.0.{build}
2+
configuration: Release
3+
4+
environment:
5+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
6+
NUGET_XMLDOC_MODE: skip
7+
GITHUB_ACCESS_TOKEN:
8+
secure: BuuXJ8z8dMoeeMPy4l7QbbNPFn1/CW9PRGZxMhH3IAFdtTftFKZHA7eqpBqiE2T3
9+
10+
init:
11+
- git config --global core.autocrlf true
12+
- git config --global user.email "[email protected]"
13+
- git config --global user.name "WiX-BoT"
14+
15+
build_script:
16+
- tools\appveyor_bld.cmd build\deploy
17+
18+
artifacts:
19+
- path: build\deploy
20+
name: deploy-artifacts
21+
22+
deploy:
23+
- provider: WebDeploy
24+
server: https://wixtoolset-staging.scm.azurewebsites.net:443/msdeploy.axd?site=wixtoolset-staging
25+
website: wixtoolset__staging
26+
username: $wixtoolset__staging
27+
password:
28+
secure: rSNrD+nlS813sckRsk5os/7NiYbvGl9faU3n1KjeCWr8iiO2lHTZTDj/NH9h3zfbagqXPAcu/f5hVjZuBqc95g==
29+
remove_files: true
30+
app_offline: true
31+
artifact: deploy-artifacts
32+
33+
on_success:
34+
- ps: tools\appveyor_tag.ps1 -GithubAccessToken $env:GITHUB_ACCESS_TOKEN -Version $env:GitBuildVersion
35+
36+
skip_tags: true

tools/appveyor_bld.cmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@setlocal
2+
3+
@set _P=%~dp0..\
4+
@set _RELATIVE_OUTPUT_FOLDER=%1
5+
6+
@if "%CONFIGURATION%"=="" set CONFIGURATION=Release
7+
@if "%_RELATIVE_OUTPUT_FOLDER%"=="" set _RELATIVE_OUTPUT_FOLDER=build\deploy
8+
9+
@pushd %_P%
10+
11+
dotnet restore Web.sln
12+
13+
dotnet publish .\src\Web\Web.csproj --configuration %CONFIGURATION% --output %CD%\%_RELATIVE_OUTPUT_FOLDER%
14+
15+
@popd
16+
@endlocal

tools/appveyor_tag.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
param (
2+
[Parameter(Mandatory=$True)]
3+
[string] $GithubAccessToken,
4+
5+
[Parameter(Mandatory=$True)]
6+
[string] $Version
7+
)
8+
9+
# Only tag builds on the master branch and not pull requests.
10+
if (($env:APPVEYOR_REPO_BRANCH -ne "master") -or (Test-Path env:\APPVEYOR_PULL_REQUEST_NUMBER))
11+
{
12+
return
13+
}
14+
15+
git config --global credential.helper store
16+
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($GithubAccessToken):[email protected]`n"
17+
18+
git tag -a v$Version -m "Build v$Version"
19+
git push --quiet --tags origin HEAD:master

0 commit comments

Comments
 (0)