-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
93 lines (81 loc) · 2.35 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# source: https://github.com/starkat99/appveyor-rust/blob/master/appveyor.yml
# source: https://github.com/japaric/rust-everywhere/blob/master/appveyor.yml
version: 0.4.0-build{build}
matrix:
fast_finish: true
environment:
PROJECT_NAME: terraform-zap
global:
BINARY_NAME: terraform-zap
ARTIFACT_DIR: artifacts
CARGO_CONFIG_DIR: .cargo
CARGO_CONFIG: .cargo\config
matrix:
# Stable channel
# - TARGET: i686-pc-windows-msvc
# CHANNEL: stable
# ARTIFACT: true
# ZIP_SUFFIX: windows-x86
# - TARGET: x86_64-pc-windows-msvc
# CHANNEL: stable
# ARTIFACT: true
# ZIP_SUFFIX: windows-x86_64
# Beta channel
# - TARGET: i686-pc-windows-msvc
# CHANNEL: beta
# - TARGET: x86_64-pc-windows-msvc
# CHANNEL: beta
# Nightly channel
- TARGET: i686-pc-windows-msvc
CHANNEL: nightly
ARTIFACT: true
ZIP_SUFFIX: windows-x86
- TARGET: x86_64-pc-windows-msvc
CHANNEL: nightly
ARTIFACT: true
ZIP_SUFFIX: windows-x86_64
install:
- curl -sSf -o rustup-init.exe https://win.rustup.rs
- rustup-init.exe --default-host %TARGET% --default-toolchain %CHANNEL% -y
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustc -vV
- cargo -vV
- if "%TARGET%"=="i686-pc-windows-gnu"
cinst mingw --x86 -y &
set PATH=%PATH%;C:\tools\mingw32\bin &
gcc --version
- if "%TARGET%"=="x86_64-pc-windows-gnu"
cinst mingw -y &
set PATH=%PATH%;C:\tools\mingw64\bin &
gcc --version
- echo %PATH%
build_script:
- cargo build --verbose
after_build:
- if "%ARTIFACT%"=="true" if "%APPVEYOR_REPO_TAG%"=="true"
mkdir %CARGO_CONFIG_DIR% &
echo [build]>>%CARGO_CONFIG% &
echo rustflags = ["-Z", "unstable-options", "-C", "target-feature=+crt-static"]>>%CARGO_CONFIG% &
cargo build --release --verbose &
mkdir %ARTIFACT_DIR% &
pushd %ARTIFACT_DIR% &
7z a %BINARY_NAME%-%APPVEYOR_REPO_TAG_NAME%-%ZIP_SUFFIX%.zip "%APPVEYOR_BUILD_FOLDER%\target\release\%BINARY_NAME%.exe" &
popd
test_script:
- cargo test --all
artifacts:
- path: $(ARTIFACT_DIR)\$(BINARY_NAME)-$(APPVEYOR_REPO_TAG_NAME)-$(ZIP_SUFFIX).zip
name: zip-release
deploy:
provider: GitHub
auth_token:
secure: "njCwSow8gtsplARSx0TLiQRB29GHALM67ClkPuE6Z8JbTR6A3k4UKDcUuJE4WK9C"
artifacts: zip-release
draft: false
prerelease: false
on:
appveyor_repo_tag: true
branches:
only:
- master
- /^v\d+\.\d+\.\d+(-\S*)?$/