forked from imazen/imageflow
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathappveyor.yml
155 lines (150 loc) · 7.95 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
image: Visual Studio 2017
build: false
environment:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 1
RUST_TOOLCHAIN: beta
VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build"
VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\"
TARGET_DIR: "target\\"
matrix:
- platform: x86
RUST_TARGET: i686-pc-windows-msvc
TARGET_CPU: x86
NUGET_RUNTIME: win7-x86
PACKAGE_SUFFIX: win-x86
BITS: 32
- platform: x64
RUST_TARGET: x86_64-pc-windows-msvc
TARGET_CPU: x86-64
NUGET_RUNTIME: win7-x64
PACKAGE_SUFFIX: win-x86_64
BITS: 64
- platform: x64
RUST_TARGET: x86_64-pc-windows-msvc
TARGET_CPU: haswell
NUGET_RUNTIME: win7-x64
PACKAGE_SUFFIX: win-x86_64-haswell
BITS: 64
configuration: Release
cache:
- '%USERPROFILE%\.cargo'
- 'target'
matrix:
fast_finish: false
#We install nasm in case libjpeg-turbo has to be built from source
install:
- dotnet --info
- SET "GIT_COMMIT=%APPVEYOR_REPO_COMMIT%"
- SET "CI_SEQUENTIAL_BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER%"
- SET "CI_BUILD_URL=https://ci.appveyor.com/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/build/%APPVEYOR_BUILD_VERSION%"
- SET "CI_JOB_TITLE=AppVeyor %APPVEYOR_BUILD_VERSION% %APPVEYOR_JOB_NAME%"
- SET "CI_JOB_URL=https://ci.appveyor.com/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/branch/%APPVEYOR_REPO_BRANCH%/job/%APPVEYOR_JOB_ID%"
- SET "CI_STRING=name:AppVeyor job_id:%APPVEYOR_JOB_ID% build_id:%APPVEYOR_BUILD_ID% build_number:%APPVEYOR_BUILD_NUMBER% build_version:%APPVEYOR_BUILD_VERSION% account_name:%APPVEYOR_ACCOUNT_NAME% project_slug:%APPVEYOR_PROJECT_SLUG% tag_name:%APPVEYOR_REPO_TAG_NAME% pull_request_number:%APPVEYOR_PULL_REQUEST_NUMBER% branch:%APPVEYOR_REPO_BRANCH%"
- SET "CI_TAG=%APPVEYOR_REPO_TAG_NAME%"
- SET "CI_REPO=%APPVEYOR_REPO_NAME%"
- SET "CI_RELATED_BRANCH=%APPVEYOR_REPO_BRANCH%"
- SET "CI_PULL_REQUEST_INFO=%APPVEYOR_PULL_REQUEST_NUMBER%"
- SET "GIT_OPTIONAL_BRANCH="
- echo "Debug GIT_OPTIONAL_BRANCH=%GIT_OPTIONAL_BRANCH%, ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%, CI_TAG=%CI_TAG%, CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%"
- if "%CI_PULL_REQUEST_INFO%"=="" SET "GIT_OPTIONAL_BRANCH=%CI_RELATED_BRANCH%"
- echo "Debug GIT_OPTIONAL_BRANCH=%GIT_OPTIONAL_BRANCH%, ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%, CI_TAG=%CI_TAG%, CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%"
- SET "ARTIFACT_SERIES_NAME=pullrequest"
- echo "Debug GIT_OPTIONAL_BRANCH=%GIT_OPTIONAL_BRANCH%, ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%, CI_TAG=%CI_TAG%, CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%"
- if "%CI_PULL_REQUEST_INFO%"=="" SET "ARTIFACT_SERIES_NAME=%CI_TAG%"
- echo "Debug GIT_OPTIONAL_BRANCH=%GIT_OPTIONAL_BRANCH%, ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%, CI_TAG=%CI_TAG%, CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%"
- if "%CI_TAG%,%CI_PULL_REQUEST_INFO%"=="," SET "ARTIFACT_SERIES_NAME=%CI_RELATED_BRANCH%"
- echo "Debug GIT_OPTIONAL_BRANCH=%GIT_OPTIONAL_BRANCH%, ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%, CI_TAG=%CI_TAG%, CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%"
- git rev-parse --short HEAD>tempfile.txt&set /p SHORT_COMMIT=<tempfile.txt
- git describe --always --tags --long>tempfile.txt&set /p DESCRIBE_ALWAYS_LONG=<tempfile.txt
- if "%CI_TAG%"=="" SET "ARTIFACT_NAME=imageflow-nightly-%ARTIFACT_SERIES_NAME%-%CI_SEQUENTIAL_BUILD_NUMBER%-%DESCRIBE_ALWAYS_LONG%-%PACKAGE_SUFFIX%"
- if NOT "%CI_TAG%"=="" SET "ARTIFACT_NAME=imageflow-%CI_TAG%-%SHORT_COMMIT%-%PACKAGE_SUFFIX%"
- SET "ESTIMATED_ARTIFACT_URL=https://ci.appveyor.com/api/buildjobs/%APPVEYOR_JOB_ID%/artifacts/%ARTIFACT_NAME%.zip"
- echo. && echo. && echo Estimated upload URL && echo. && echo %ESTIMATED_ARTIFACT_URL% && echo. && echo.
- echo "GIT_COMMIT=%GIT_COMMIT%" && echo "CI_STRING=%CI_STRING%" && echo "CI_TAG=%CI_TAG%" && echo "CI_RELATED_BRANCH=%CI_RELATED_BRANCH%" && echo "CI_PULL_REQUEST_INFO=%CI_PULL_REQUEST_INFO%" && echo "ARTIFACT_SERIES_NAME=%ARTIFACT_SERIES_NAME%"
- echo.
- echo. && echo. echo Installing tools
#- refreshenv
#- vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended
#- C:\"Program Files (x86)"\"%VSINSTALL%"\vcvarsall.bat %PLATFORM%
- SET TARGET_ARG= #--target=%RUST_TARGET%
- echo "RUST_TARGET=%RUST_TARGET%, TARGET=%TARGET%, BITS=%BITS%, CPU_TARGET=%CPU_TARGET% RUSTFLAGS=%RUSTFLAGS%"
- SET RUSTUP_INIT=https://static.rust-lang.org/rustup/dist/%RUST_TARGET%/rustup-init.exe
- echo Fetching %RUSTUP_INIT%
- curl -L -o rustup-init.exe %RUSTUP_INIT%
- rustup-init.exe -y --default-toolchain %RUST_TOOLCHAIN% --default-host %RUST_TARGET%
- set PATH=%PATH%;C:\Program Files (x86)\nasm;%USERPROFILE%\.cargo\bin
- rustc --version --verbose
- echo. && echo. && echo Installing NASM
- curl -L -o nasminst.exe http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe
- start /wait nasminst.exe /S
test_script:
- if NOT "%CI_TAG%"=="" echo Purging build files for %CI_TAG%
- if NOT "%CI_TAG%"=="" rmdir /s /q target || exit 0
- if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0
- if NOT "%CI_TAG%"=="" SET CARGO_INCREMENTAL=0
- echo %PATH%
- rustc -V
- cargo -V
- nasm -v
- SET RUST_TEST_THREADS=1
- cd %APPVEYOR_BUILD_FOLDER%
- cargo test --all --release %TARGET_ARG%
- cargo build --all --release %TARGET_ARG%
- echo. && echo Displaying embedded info (release build of imageflow_tool) && echo .
- .\%TARGET_DIR%release\imageflow_tool.exe diagnose --show-compilation-info
- .\%TARGET_DIR%release\imageflow_tool.exe diagnose --self-test
- .\%TARGET_DIR%release\imageflow_tool.exe diagnose --call-panic || exit 0
- echo. && echo Displaying embedded info (release build of imageflow_server) && echo .
- .\%TARGET_DIR%release\imageflow_tool.exe diagnose --show-compilation-info
- echo. && echo Generating docs && echo .
- rmdir /q /s .\%TARGET_DIR%doc || exit 0
- cargo doc --all --no-deps --release %TARGET_ARG%
- cd .\%TARGET_DIR%doc
- 7z a -r "..\docs.zip" *
- cd %APPVEYOR_BUILD_FOLDER%
- rmdir /q /s .\artifacts || exit 0
- mkdir .\artifacts\staging\headers
- dir %TARGET_DIR%release\
- xcopy /Y %TARGET_DIR%release\imageflow_server.exe artifacts\staging\
- xcopy /Y %TARGET_DIR%release\imageflow_server.pdb artifacts\staging\ || exit 0
- xcopy /Y %TARGET_DIR%release\imageflow.dll artifacts\staging\
- xcopy /Y %TARGET_DIR%release\imageflow.pdb artifacts\staging\ || exit 0
- xcopy /Y %TARGET_DIR%release\imageflow_tool.exe artifacts\staging\
- xcopy /Y %TARGET_DIR%release\imageflow_tool.pdb artifacts\staging\ || exit 0
- xcopy /Y .\bindings\headers\*.h .\artifacts\staging\headers
- xcopy /Y /E %TARGET_DIR%docs.zip artifacts\staging\
- rmdir /q /s .\artifacts\staging\doc || exit 0
- rmdir /q /s .\artifacts\staging\release || exit 0
- cd artifacts\staging
- 7z a -r "..\..\%ARTIFACT_NAME%.zip" *
- cd %APPVEYOR_BUILD_FOLDER%
- appveyor PushArtifact "%ARTIFACT_NAME%.zip"
- sh ./ci/pack_nuget/pack.sh
- sh ./ci/pack_nuget/pack.sh tool
- echo. && echo. && echo Cleaning up
- rmdir /q /s .\%TARGET_DIR%doc || exit 0
- rmdir /q /s .\%TARGET_DIR%debug || exit 0
- if NOT "%CI_TAG%"=="" echo Purging build files following %CI_TAG%
- if NOT "%CI_TAG%"=="" rmdir /s /q target || exit 0
- if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0
artifacts:
- path: 'artifacts\*'
name: Rust binaries
- path: 'artifacts\nuget\*.nupkg'
name: NuGet Packages
deploy:
- provider: GitHub
description: 'imageflow-win'
artifact: /.*\.zip/
draft: false
prerelease: true
auth_token:
secure: 3h3WYw5/HWY1FxuR89OHsoDenpQWkmGXEFzxTBxLdgID37mmThDEqFM3xyyXk+Tq
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: vQj0uASp+URSv7pV5idYAZsdZlTigr/2uPZbnsVFrct7QwvPsa5Ljv39j4m7VlTv
skip_symbols: true
artifact: /.*\.nupkg/