2016-08-27 10:50:37 +00:00
|
|
|
version: "{build}"
|
|
|
|
|
|
|
|
os: Windows Server 2012 R2
|
|
|
|
|
|
|
|
environment:
|
|
|
|
GOPATH: c:\gopath
|
2016-12-20 17:51:56 +00:00
|
|
|
matrix:
|
2016-12-22 05:45:58 +00:00
|
|
|
#- MSI_ARCH: amd64
|
|
|
|
# GO_BUILDARCH: amd64
|
2016-12-20 17:51:56 +00:00
|
|
|
- MSI_ARCH: x86
|
2016-12-22 05:45:58 +00:00
|
|
|
GO_BUILDARCH: 386
|
2016-08-27 10:50:37 +00:00
|
|
|
|
2016-08-27 10:52:42 +00:00
|
|
|
clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter
|
|
|
|
|
2016-08-27 10:50:37 +00:00
|
|
|
install:
|
2016-08-27 10:52:42 +00:00
|
|
|
- go version
|
2016-08-27 10:50:37 +00:00
|
|
|
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
2016-09-01 19:10:02 +00:00
|
|
|
- go get -u github.com/kardianos/govendor
|
2016-10-13 07:07:41 +00:00
|
|
|
- go get -u github.com/prometheus/promu
|
2016-10-18 12:13:36 +00:00
|
|
|
- choco install gitversion.portable -y
|
2016-08-27 10:50:37 +00:00
|
|
|
|
|
|
|
build_script:
|
2016-10-18 12:13:36 +00:00
|
|
|
- ps: gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru
|
2016-12-22 05:45:58 +00:00
|
|
|
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
2016-09-01 19:10:02 +00:00
|
|
|
- govendor test -v +local
|
2016-10-13 07:07:41 +00:00
|
|
|
- promu build -v .
|
2016-09-16 06:36:58 +00:00
|
|
|
- ps: |
|
|
|
|
if($env:APPVEYOR_REPO_TAG -eq "True") {
|
|
|
|
# The MSI version is not semver compliant, so just take the numerical parts
|
|
|
|
$Version = $env:APPVEYOR_REPO_TAG_NAME -replace '^v?([0-9\.]+).*$','$1'
|
|
|
|
Write-Verbose "Setting msi version to $Version"
|
2016-12-20 17:51:56 +00:00
|
|
|
.\installer\build.ps1 -PathToExecutable .\wmi_exporter.exe -Version $Version -Arch "$env:MSI_ARCH"
|
|
|
|
Push-AppveyorArtifact installer\Output\wmi_exporter-$Version-$env:MSI_ARCH.msi -DeploymentName Installer
|
2016-09-16 06:36:58 +00:00
|
|
|
}
|
|
|
|
|
2016-12-20 17:51:56 +00:00
|
|
|
after_build:
|
|
|
|
- 7z a wmi_exporter-%MSI_ARCH%.zip wmi_exporter.exe
|
|
|
|
|
2016-09-16 06:36:58 +00:00
|
|
|
artifacts:
|
|
|
|
- name: Executable
|
2016-12-20 17:51:56 +00:00
|
|
|
path: 'wmi_exporter-*.zip'
|
2016-09-09 22:06:43 +00:00
|
|
|
|
|
|
|
deploy:
|
2016-09-16 06:36:58 +00:00
|
|
|
- provider: GitHub
|
|
|
|
description: WMI Exporter version $(appveyor_build_version)
|
|
|
|
artifact: Executable,Installer
|
|
|
|
auth_token:
|
|
|
|
secure: 'CrXWeTf7qONUOEki5olFfGEUPMLDeHj61koDXV3OVEaLgtACmnVHsKUub9POflda'
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
on:
|
|
|
|
appveyor_repo_tag: true
|