forked from mh-cbon/go-msi
-
Notifications
You must be signed in to change notification settings - Fork 9
/
appveyor.yml
61 lines (53 loc) · 1.92 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
58
59
60
61
image: Visual Studio 2017
clone_folder: c:\gopath\src\github.com\%APPVEYOR_ACCOUNT_NAME%\%APPVEYOR_PROJECT_SLUG%
# skip_non_tags: true
# environment variables
environment:
GOPATH: c:\gopath
VCS_URL: https://github.com/%APPVEYOR_REPO_NAME%
GH_TOKEN:
secure: YEjhn1NO585Rghl8OYwDX3WaJRdmRlo3LpxB7f5T6GhtkVpwgiFxTpOrDJ8lOnrz
install:
- choco install changelog gh-api-cli -y
- refreshenv
- set GH_APP=%APPVEYOR_PROJECT_NAME%
- set GH_USER=%APPVEYOR_ACCOUNT_NAME%
- set VERSION=%APPVEYOR_REPO_TAG_NAME%
- if "%x%"=="%VERSION%" set VERSION=2.0.0
- set PATH=%WIX%\bin;%PATH%
- set PATH=%GOPATH%\bin;%PATH%
- go get -u github.com/mh-cbon/never-fail
before_test:
# do a manual installation of go-msi from pulled source code
- mkdir C:\go-msi\
- set GOARCH=amd64
- go build -o C:\go-msi\go-msi.exe --ldflags "-X main.Version=%VERSION%" main.go
- XCOPY /I /E templates C:\go-msi\templates
# run tests
- go run testing\main.go
build_script:
# x386
- set GOARCH=386
- go build -o %GH_APP%-%GOARCH%.exe --ldflags "-X main.Version=%VERSION%" main.go
# amd64
- set GOARCH=amd64
- go build -o %GH_APP%-%GOARCH%.exe --ldflags "-X main.Version=%VERSION%" main.go
deploy_script:
# next section is a workaround for https://github.com/appveyor/ci/issues/1752
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "%GH_APP%-386.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "%GH_APP%-amd64.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
artifacts:
- path: '%GH_APP%-386.msi'
name: bin-x86
- path: '%GH_APP%-amd64.msi'
name: bin-x64
deploy:
- provider: GitHub
artifact: bin-x86, bin-x64
draft: false
prerelease: false
desription: "Release %APPVEYOR_REPO_TAG_NAME%"
auth_token:
secure: YEjhn1NO585Rghl8OYwDX3WaJRdmRlo3LpxB7f5T6GhtkVpwgiFxTpOrDJ8lOnrz
on:
appveyor_repo_tag: true # deploy on tag push only