forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
57 lines (50 loc) · 2.39 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
image: Visual Studio 2017
clone_folder: 'c:\gopath\src\github.com\%APPVEYOR_REPO_NAME%'
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
environment:
# improve readability
VCS_URL: 'https://github.com/%APPVEYOR_REPO_NAME%'
# specific to go
VERSION: "%APPVEYOR_REPO_TAG_NAME:v=%"
GOPATH: c:\gopath
CGO_ENABLED: '0'
GOARCH: amd64
BINTRAY_KEY:
secure: /0S6SdBwfiuWEdY4SKJcZpxEV+QpsfJfqx3QqYbnK8vwmB2KMGqerGzQRnIrkbGD
GPG_PASSPHRASE:
secure: CMQ+U+qVVdhIr1Eip5nGPbaGFggVvSjg/BpSY0EpLbQ=
# prepare system and project
install:
- choco install wixtoolset pandoc -y
- refreshenv
# ensure wix is available in PATH
- set PATH=%WIX%\bin;%PATH%
# specific to go
- set PATH=%GOPATH%\bin;%PATH%
# build msi artifacts
build_script:
# In case of non tag build, mock a version
- if "%APPVEYOR_REPO_TAG%" == "false" (set VERSION="0.0.1")
- pandoc -s -f markdown -t rtf -o packaging\LICENSE.rtf LICENSE.md
- go build -a -ldflags "-s -w" -o packaging\k6.exe
- cd packaging
- candle.exe -arch x64 -dVERSION=%VERSION% k6.wxs
- light.exe -ext WixUIExtension k6.wixobj
deploy_script:
# Checking if the build has started by pushed tag
- ps: |
if ( $env:APPVEYOR_REPO_TAG -eq "false" ) { Exit-AppveyorBuild }
# Publishing the msi
- 'curl -H "X-GPG-PASSPHRASE: %GPG_PASSPHRASE%" -T k6.msi "https://%BINTRAY_USER%:%BINTRAY_KEY%@api.bintray.com/content/loadimpact/windows/k6/%VERSION%/k6-v%VERSION%-amd64.msi?publish=1&override=1"'
- 'curl -H "X-GPG-PASSPHRASE: %GPG_PASSPHRASE%" -T k6.msi "https://%BINTRAY_USER%:%BINTRAY_KEY%@api.bintray.com/content/loadimpact/windows/k6/latest/k6-latest-amd64.msi?publish=1&override=1"'
- ps: |
# Create Chocolately Package
mkdir .\k6.portable
Copy-Item -Path .\k6.portable.nuspec -Destination .\k6.portable\k6.portable.nuspec
Copy-Item -Path .\k6.exe -Destination .\k6.portable\k6.exe
Set-Location -Path .\k6.portable\
(Get-Content '.\k6.portable.nuspec' -Raw).Replace("<version>__REPLACE__</version>", "<version>$($env:APPVEYOR_REPO_TAG_NAME.substring(1))</version>") | Out-File '.\k6.portable.nuspec'
choco pack
# Publising the chocolatey package
- 'curl -H "X-GPG-PASSPHRASE: %GPG_PASSPHRASE%" -T .\k6.portable.%VERSION%.nupkg "https://%BINTRAY_USER%:%BINTRAY_KEY%@api.bintray.com/content/loadimpact/choco/k6.portable/%VERSION%/k6.portable.%VERSION%.nupkg?publish=1&override=1"'