From f60211aba32de7c801ea0d8d817c23e49fa1db5a Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Tue, 20 Dec 2016 18:51:56 +0100 Subject: [PATCH 1/4] Compile for both x86 and amd64 --- appveyor.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 72b75e23..b624fd9d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,11 @@ os: Windows Server 2012 R2 environment: GOPATH: c:\gopath + matrix: + - MSI_ARCH: amd64 + GOARCH: amd64 + - MSI_ARCH: x86 + GOARCH: 386 clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter @@ -23,13 +28,16 @@ build_script: # 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 + .\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 } +after_build: + - 7z a wmi_exporter-%MSI_ARCH%.zip wmi_exporter.exe + artifacts: - name: Executable - path: wmi_exporter.exe + path: 'wmi_exporter-*.zip' deploy: - provider: GitHub From 8df4ea3f5120e9baf0a4410c1dcec9d9cd4faeb1 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Thu, 22 Dec 2016 06:45:58 +0100 Subject: [PATCH 2/4] Debug x86 build failure --- appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b624fd9d..ae17d575 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,10 +5,10 @@ os: Windows Server 2012 R2 environment: GOPATH: c:\gopath matrix: - - MSI_ARCH: amd64 - GOARCH: amd64 + #- MSI_ARCH: amd64 + # GO_BUILDARCH: amd64 - MSI_ARCH: x86 - GOARCH: 386 + GO_BUILDARCH: 386 clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter @@ -21,6 +21,7 @@ install: build_script: - ps: gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru + - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - govendor test -v +local - promu build -v . - ps: | From 84828143433cf973a968985dda5e979b56cdc7a9 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Thu, 22 Dec 2016 06:54:46 +0100 Subject: [PATCH 3/4] Add arch-specific go-bin directory to path --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ae17d575..b0065810 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,16 +5,16 @@ os: Windows Server 2012 R2 environment: GOPATH: c:\gopath matrix: - #- MSI_ARCH: amd64 - # GO_BUILDARCH: amd64 + - MSI_ARCH: amd64 + GOARCH: amd64 - MSI_ARCH: x86 - GO_BUILDARCH: 386 + GOARCH: 386 clone_folder: c:\gopath\src\github.com\martinlindhe\wmi_exporter install: - go version - - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - set PATH=%GOPATH%\bin;c:\go\bin;%GOPATH%\bin\windows_%GOARCH%;%PATH% - go get -u github.com/kardianos/govendor - go get -u github.com/prometheus/promu - choco install gitversion.portable -y From e65b7859959f881dd67dc7c0d04591a64021a031 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Thu, 22 Dec 2016 07:45:09 +0100 Subject: [PATCH 4/4] Remove rdp-debug --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b0065810..fa83dbba 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,6 @@ install: build_script: - ps: gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - govendor test -v +local - promu build -v . - ps: |