windows_exporter/appveyor.yml

47 lines
1.4 KiB
YAML

version: "{build}"
os: Windows Server 2012 R2
environment:
GOPATH: c:\gopath
GOVERSION: 1.7
clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter
install:
- go version
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.zip
- 7z x go%GOVERSION%.windows-amd64.zip -y -oC:\ > NUL
- go version
- go env
- go get -u github.com/kardianos/govendor
build_script:
- govendor build -v +p
- govendor test -v +local
- 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"
.\installer\build.ps1 -PathToExecutable .\wmi_exporter.exe -Version $Version -Arch "amd64"
Push-AppveyorArtifact installer\Output\wmi_exporter-$Version-amd64.msi -DeploymentName Installer
}
artifacts:
- name: Executable
path: wmi_exporter.exe
deploy:
- 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