-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathappveyor.yml
67 lines (57 loc) · 2.09 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
62
63
64
65
66
67
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: ngbsm9x1/3brsx+4LDkgEtic5icav3AGs/omGGjorQ07/WjURDjb6VbxahKU03QI
install:
- choco source add -n=mh-cbon -s="https://api.bintray.com/nuget/mh-cbon/choco"
- choco install changelog gh-api-cli -y
- choco install go-msi -y
- refreshenv
- set GH_APP=%APPVEYOR_PROJECT_NAME%
- set GH_USER=%APPVEYOR_ACCOUNT_NAME%
- set VERSION=%APPVEYOR_REPO_TAG_NAME%
- set PATH=%WIX%\bin;%PATH%
- set PATH=%GOPATH%\bin;%PATH%
- go get -u github.com/mh-cbon/never-fail
- go get -u github.com/golang/dep/cmd/dep
- go get -u github.com/mh-cbon/go-msi
# build msi artifacts
build_script:
- set GOOS=windows
# x386
- set GOARCH=386
- mkdir bin\win\application
- dep ensure
- go build -o bin\win\application\eltrade.exe main.go
- cd bin\win && go-msi set-guid
- go-msi make --msi %GH_APP%-%GOARCH%-%VERSION%.msi --version %VERSION% --arch %GOARCH%
- cp %GH_APP%-%GOARCH%-%VERSION%.msi %GH_APP%-%GOARCH%.msi
# nuget package is built only for the x86 arch.
# amd64
- set GOARCH=amd64
- go build -o bin\win\application\eltrade.exe main.go
- go-msi make --msi %GH_APP%-%GOARCH%-%VERSION%.msi --version %VERSION% --arch %GOARCH%
- cp %GH_APP%-%GOARCH%-%VERSION%.msi %GH_APP%-%GOARCH%.msi
deploy_script:
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-386.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-amd64.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
artifacts:
- path: '*-386.msi'
name: msi-x86
- path: '*-amd64.msi'
name: msi-x64
deploy:
- provider: GitHub
artifact: msi-x86, msi-x64
draft: false
prerelease: false
desription: "Release %APPVEYOR_REPO_TAG_NAME%"
auth_token:
secure: ngbsm9x1/3brsx+4LDkgEtic5icav3AGs/omGGjorQ07/WjURDjb6VbxahKU03QI
on:
appveyor_repo_tag: true # deploy on tag push only