forked from benjaminbollen/maidsafe_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
102 lines (90 loc) · 4.38 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
environment:
global:
RUST_BACKTRACE: 1
SAFE_MEMORY_STORE: 1
matrix:
- RUST_TOOLCHAIN: 1.19.0
cache:
- '%USERPROFILE%\.cargo'
- '%APPVEYOR_BUILD_FOLDER%\target'
clone_depth: 1
install:
- ps: |
$url = "https://github.com/maidsafe/QA/raw/master/appveyor/install_rustup.ps1"
Invoke-WebRequest $url -OutFile "install_rustup.ps1"
. ".\install_rustup.ps1"
platform:
- x86
- x64
configuration:
- Release
skip_tags: true
before_build:
- ps: |
$COMMIT_MESSAGE = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED"
if ($COMMIT_MESSAGE -match "[Vv]ersion change.*safe_authenticator to ([^;]+)") {
$COMMIT_MESSAGE_VERSION = "v" + $Matches[1]
$env:SAFE_AUTHENTICATOR_VERSION = (cargo pkgid --manifest-path=safe_authenticator/Cargo.toml) -Replace '.*[:#](.*)', 'v$1'
if ($COMMIT_MESSAGE_VERSION -ne $env:SAFE_AUTHENTICATOR_VERSION) {
Write-Error "Version mismatch between commit message and Cargo.toml for safe_authenticator."
exit 1
}
} else {
$env:SAFE_AUTHENTICATOR_VERSION = $env:APPVEYOR_REPO_COMMIT.Substring(0,7)
}
if ($COMMIT_MESSAGE -match "[Vv]ersion change.*safe_app to ([^;]+)") {
$COMMIT_MESSAGE_VERSION = "v" + $Matches[1]
$env:SAFE_APP_VERSION = (cargo pkgid --manifest-path=safe_app/Cargo.toml) -Replace '.*[:#](.*)', 'v$1'
if ($COMMIT_MESSAGE_VERSION -ne $env:SAFE_APP_VERSION) {
Write-Error "Version mismatch between commit message and Cargo.toml for safe_app."
exit 1
}
} else {
$env:SAFE_APP_VERSION = $env:APPVEYOR_REPO_COMMIT.Substring(0,7)
}
build_script:
- |-
cargo check --verbose --release --lib --tests --manifest-path=ffi_utils/Cargo.toml
cargo check --verbose --release --features testing --lib --tests --manifest-path=safe_core/Cargo.toml
cargo check --verbose --features testing --release --lib --tests --manifest-path=safe_authenticator/Cargo.toml
cargo check --verbose --release --features testing --lib --tests --manifest-path=safe_app/Cargo.toml
after_build:
- ps: |
if (git diff --shortstat) {
Write-Error "Working tree is dirty after building. Probably Cargo.lock should be updated."
git status
exit 1
}
test_script:
- |-
cargo test --verbose --release --manifest-path=ffi_utils/Cargo.toml
cargo test --verbose --release --features=use-mock-routing --manifest-path=safe_core/Cargo.toml
cargo test --verbose --release --features=use-mock-routing --manifest-path=safe_authenticator/Cargo.toml
cargo test --verbose --release --features=use-mock-routing --manifest-path=safe_app/Cargo.toml
before_deploy:
- cargo build --verbose --release --features=use-mock-routing --manifest-path=safe_authenticator/Cargo.toml
- cargo build --verbose --release --features=use-mock-routing --manifest-path=safe_app/Cargo.toml
- strip target\release\safe_authenticator.dll target\release\safe_app.dll
- 7z a -mx9 safe_authenticator-mock-%SAFE_AUTHENTICATOR_VERSION%-win-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\target\release\safe_authenticator.dll
- 7z a -mx9 safe_app-mock-%SAFE_APP_VERSION%-win-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\target\release\safe_app.dll
- appveyor PushArtifact safe_authenticator-mock-%SAFE_AUTHENTICATOR_VERSION%-win-%PLATFORM%.zip
- appveyor PushArtifact safe_app-mock-%SAFE_APP_VERSION%-win-%PLATFORM%.zip
- cargo build --verbose --release --manifest-path=safe_authenticator/Cargo.toml
- cargo build --verbose --release --manifest-path=safe_app/Cargo.toml
- strip target\release\safe_authenticator.dll target\release\safe_app.dll
- 7z a -mx9 safe_authenticator-%SAFE_AUTHENTICATOR_VERSION%-win-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\target\release\safe_authenticator.dll
- 7z a -mx9 safe_app-%SAFE_APP_VERSION%-win-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\target\release\safe_app.dll
- appveyor PushArtifact safe_authenticator-%SAFE_AUTHENTICATOR_VERSION%-win-%PLATFORM%.zip
- appveyor PushArtifact safe_app-%SAFE_APP_VERSION%-win-%PLATFORM%.zip
deploy:
provider: S3
access_key_id: AKIAIA2TXTG7EV5VIG2Q
secret_access_key:
secure: WtcjRuYVPF9Fhv1qBVBG+rP6VR7HEa+IayW1L8GqhgUJmp1M8gV4J9u/TdY5Fsb2
bucket: safe-client-libs
region: eu-west-2
set_public: true
artifact: /.*\.zip/
on:
branch: master
RUST_TOOLCHAIN: 1.19.0