forked from rust-lang/rustup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappveyor.yml
More file actions
80 lines (71 loc) · 2.75 KB
/
appveyor.yml
File metadata and controls
80 lines (71 loc) · 2.75 KB
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
environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
- TARGET: i686-pc-windows-msvc
- TARGET: x86_64-pc-windows-gnu
BITS: 64
- TARGET: i686-pc-windows-gnu
BITS: 32
access_token:
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
branches:
only:
- master
- new
install:
- ps: |
# Install Rust
Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" -FileName "rust-nightly.exe"
.\rust-nightly.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null
$env:PATH="$env:PATH;C:\rust\bin"
New-Item .cargo -type directory
Copy-Item .appveyor.cargo-config.toml .cargo/config
# For -gnu builds
if ($env:TARGET -match "-gnu$") {
$env:PATH="$env:PATH;C:\msys64\mingw${env:BITS}\bin"
}
# For -msvc builds
if ($env:TARGET -match "-msvc$") {
Start-FileDownload "http://www.npcglib.org/~stathis/downloads/openssl-1.0.2d-vs2015.7z" -FileName "openssl.7z"
7z x openssl.7z -o"C:\OpenSSL" | Out-Null
}
# Print version info
rustc -vV
cargo -vV
# Configure git
git config --global user.email "[email protected]"
git config --global user.name "Diggory Blake (via Appveyor CI)"
git config --global push.default simple
build: false
test_script:
- cargo build --release
- cargo test --release -p multirust-dist
- cargo test --release
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/9907ad94eb7a5ff291c3
on_success:
- ps: |
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
cargo build --release
# Generate hashes
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
$bin = "binaries\$env:TARGET"
} else {
$bin = "binaries\$env:APPVEYOR_REPO_BRANCH\$env:TARGET"
}
cmd /c "git config --global credential.helper store 2>&1"
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
cmd /c "git submodule init 2>&1"
cmd /c "git submodule update --depth 1 --remote 2>&1"
if (!(Test-Path -Path "$bin")) { mkdir "$bin" }
cmd /c "del /Q `"$bin`""
cmd /c "copy /B /Y `"target\release\*`" `"$bin`""
cmd /c "git rev-parse HEAD > `"$bin\commit.txt`" 2>&1"
cd binaries
cmd /c "git checkout master 2>&1"
cmd /c "git add -A 2>&1"
cmd /c "git commit -m `"Auto-update $env:APPVEYOR_REPO_BRANCH/$env:TARGET binaries (Appveyor CI)`" 2>&1"
$attempts = 1; do { .\push-changes.bat; $attempts++ } while($lastexitcode -ne '0' -and $attempts -le 5)
}