mindoc/appveyor.yml

60 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2021-03-27 21:40:36 +08:00
version: 1.0.{build}
branches:
only:
- master
image: Visual Studio 2022
2021-03-27 21:40:36 +08:00
clone_folder: c:\gopath\src\github.com\mindoc-org\mindoc
init:
- cmd: >-
2022-05-09 17:11:09 +08:00
if [%tbs_arch%]==[x86] SET PATH=C:\msys64\mingw32\bin;%PATH%
2022-05-09 17:17:08 +08:00
2022-05-09 17:11:09 +08:00
if [%tbs_arch%]==[x64] SET PATH=C:\msys64\mingw64\bin;%PATH%
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
SET PATH=%GOPATH%\bin;%GOBIN%;%PATH%
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
FOR /f "delims=" %%i IN ('go version') DO (SET GO_VERSION=%%i)
2022-05-09 17:17:08 +08:00
2022-05-09 17:11:09 +08:00
git config --global --add safe.directory /cygdrive/c/gopath/src/github.com/mindoc-org/mindoc
2017-05-30 19:31:28 +08:00
environment:
GOPATH: c:\gopath
2021-03-27 21:40:36 +08:00
GOBIN: c:\gobin
GO111MODULE: on
CGO_ENABLED: 1
2017-05-30 20:20:10 +08:00
matrix:
2021-03-27 21:40:36 +08:00
- tbs_arch: x86
GOARCH: 386
2022-05-09 17:11:09 +08:00
job_name: job_x86
2021-03-27 21:40:36 +08:00
- tbs_arch: x64
GOARCH: amd64
2022-05-09 17:11:09 +08:00
job_name: job_x64
2021-03-27 21:40:36 +08:00
install:
- cmd: >-
echo %PATH%
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
echo %GO_VERSION%
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
go env
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
where gcc
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
where g++
2017-05-30 20:46:00 +08:00
build_script:
2021-03-27 21:40:36 +08:00
- cmd: >-
cd c:\gopath\src\github.com\mindoc-org\mindoc
2022-05-09 17:17:08 +08:00
2022-05-09 17:11:09 +08:00
go mod tidy -v
2022-05-09 17:17:08 +08:00
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 'github.com/mindoc-org/mindoc/conf.GO_VERSION=%GO_VERSION%'"
2022-05-09 17:17:08 +08:00
2022-07-20 15:04:01 +08:00
7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* conf/lang/* static/* mindoc_windows_%GOARCH%.exe views/* uploads/* lib/* LICENSE.md
2021-03-27 21:40:36 +08:00
test_script:
- cmd: >-
cd c:\gopath\src\github.com\mindoc-org\mindoc
2022-05-09 17:17:08 +08:00
pwsh -NoProfile -ExecutionPolicy Bypass -Command "& {Copy-Item -Force -Path 'conf\app.conf.example' -Destination 'conf\app.conf'}"
2022-05-09 17:17:08 +08:00
2021-03-27 21:40:36 +08:00
mindoc_windows_%GOARCH%.exe version
2022-05-09 17:11:09 +08:00
artifacts:
- path: mindoc_windows_*.7z
2022-05-09 17:17:08 +08:00
deploy: off