mirror of https://github.com/mindoc-org/mindoc.git
update AppVeyor CI/CD config
parent
bae6826a97
commit
e8ec1cce0e
100
appveyor.yml
100
appveyor.yml
|
@ -1,65 +1,53 @@
|
||||||
version: "{build}"
|
version: 1.0.{build}
|
||||||
clone_folder: c:\gopath\src\github.com\lifei6671\mindoc
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
image: Visual Studio 2015
|
||||||
|
clone_folder: c:\gopath\src\github.com\mindoc-org\mindoc
|
||||||
|
init:
|
||||||
|
- cmd: >-
|
||||||
|
if [%tbs_arch%]==[x86] SET PATH=C:\MinGW\bin;%PATH%
|
||||||
|
|
||||||
|
if [%tbs_arch%]==[x64] SET PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
||||||
|
|
||||||
|
SET PATH=%GOPATH%\bin;%GOBIN%;%PATH%
|
||||||
|
|
||||||
|
FOR /f "delims=" %%i IN ('go version') DO (SET GO_VERSION=%%i)
|
||||||
environment:
|
environment:
|
||||||
GOPATH: c:\gopath
|
GOPATH: c:\gopath
|
||||||
GOVERSION: "1.12"
|
GOBIN: c:\gobin
|
||||||
|
GO111MODULE: on
|
||||||
|
CGO_ENABLED: 1
|
||||||
matrix:
|
matrix:
|
||||||
- tbs_arch: "x86"
|
- tbs_arch: x86
|
||||||
tbs_tools: "mingw"
|
GOARCH: 386
|
||||||
tbs_static_runtime: 1
|
- tbs_arch: x64
|
||||||
GOARCH: 386
|
GOARCH: amd64
|
||||||
|
|
||||||
- tbs_arch: "x64"
|
|
||||||
tbs_tools: "mingw"
|
|
||||||
tbs_static_runtime: 1
|
|
||||||
GOARCH: amd64
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x64')
|
- cmd: >-
|
||||||
{
|
echo %PATH%
|
||||||
Start-FileDownload "http://libgd.blob.core.windows.net/mingw/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mingw_x86_64.7z;
|
|
||||||
7z x -oC:\ mingw_x86_64.7z | out-null;
|
|
||||||
}
|
|
||||||
- ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x86')
|
|
||||||
{
|
|
||||||
Start-FileDownload "http://libgd.blob.core.windows.net/mingw/i686-4.9.1-release-posix-dwarf-rt_v3-rev1.7z" -FileName mingw_x86.7z;
|
|
||||||
7z x -oC:\ mingw_x86.7z | out-null;
|
|
||||||
}
|
|
||||||
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
|
||||||
- echo %PATH%
|
|
||||||
- echo %GOPATH%
|
|
||||||
- go version
|
|
||||||
- go env
|
|
||||||
|
|
||||||
|
echo %GO_VERSION%
|
||||||
|
|
||||||
|
go env
|
||||||
|
|
||||||
|
where gcc
|
||||||
|
|
||||||
|
where g++
|
||||||
build_script:
|
build_script:
|
||||||
- if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x86] SET PATH=C:\mingw32\bin;%PATH%
|
- cmd: >-
|
||||||
- if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x64] SET PATH=C:\mingw64\bin;%PATH%
|
cd c:\gopath\src\github.com\mindoc-org\mindoc
|
||||||
- set CGO_ENABLED=1
|
|
||||||
- for /f "delims=" %%i in ('go version') do (set GO_VERSION=%%i)
|
go mod tidy
|
||||||
- cd c:\gopath\src\github.com\lifei6671\mindoc
|
|
||||||
- go mod tidy
|
go build -ldflags "-w"
|
||||||
- go build -v -o "mindoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/mindoc-org/mindoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=%date% %time%' -X 'conf.GO_VERSION=%GO_VERSION%'"
|
|
||||||
- 7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* static/* mindoc_windows_%GOARCH%.exe views/* uploads/*
|
go build -v -o "mindoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/mindoc-org/mindoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=%date% %time%' -X 'conf.GO_VERSION=%GO_VERSION%'"
|
||||||
|
|
||||||
|
7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* static/* mindoc_windows_%GOARCH%.exe views/* uploads/*
|
||||||
test_script:
|
test_script:
|
||||||
- mindoc_windows_%GOARCH%.exe version
|
- cmd: >-
|
||||||
|
cd c:\gopath\src\github.com\mindoc-org\mindoc
|
||||||
|
|
||||||
notifications:
|
mindoc_windows_%GOARCH%.exe version
|
||||||
- provider: Email
|
deploy: off
|
||||||
to:
|
|
||||||
- lifei6671@163.com
|
|
||||||
on_build_success: false
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
- path: mindoc_windows_%GOARCH%.7z
|
|
||||||
name: Releases
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
- provider: GitHub
|
|
||||||
auth_token:
|
|
||||||
secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB"
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
artifact: mindoc_windows_%GOARCH%.7z
|
|
||||||
on:
|
|
||||||
appveyor_repo_tag: true
|
|
Loading…
Reference in New Issue