This repository has been archived by the owner on Dec 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
84 lines (81 loc) · 2.76 KB
/
azure-pipelines.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
strategy:
matrix:
MacOS:
imageName: "macos-10.13"
toolchain: stable
platformSuffix: darwin
Windows:
imageName: "vs2017-win2016"
toolchain: stable-i686-pc-windows-msvc
platformSuffix: win32
Linux:
imageName: "ubuntu-16.04"
toolchain: stable
platformSuffix: linux
trigger:
branches:
include: ["*"]
tags:
include: ["*"]
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.13.x'
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install Rust on non-Windows
env:
TOOLCHAIN: $()
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Install Rust on Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build
displayName: Cargo build debug
- script: cargo test --all
displayName: Cargo test
- script: npm install
displayName: Install JS dependencies
- script: npm test
displayName: Run JS tests
- script: cargo build --release
displayName: Cargo build release
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- bash: |
if [ -e target/release/notify-subprocess ]
then
cp target/release/notify-subprocess "$BUILD_ARTIFACTSTAGINGDIRECTORY/notify-subprocess-$PLATFORMSUFFIX"
fi
if [ -e target/release/notify-subprocess.exe ]
then
cp target/release/notify-subprocess.exe "$BUILD_ARTIFACTSTAGINGDIRECTORY/notify-subprocess-$PLATFORMSUFFIX.exe"
fi
displayName: Stage release artifacts
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- bash: |
TAG="$(Build.SourceBranch)"
TAG=${TAG#refs/tags/}
echo $TAG
echo "##vso[task.setvariable variable=build.releaseTag]$TAG"
displayName: "Assign tag variable for GitHub release"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- task: GithubRelease@0
displayName: "Upload to GitHub release"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
gitHubConnection: nathansobo
repositoryName: atom/notify
action: edit
target: $(build.sourceVersion)
tagSource: manual
tag: $(build.releaseTag)
assets: "$(Build.ArtifactStagingDirectory)/*"
title: $(build.releaseTag)
assetUploadMode: replace
addChangeLog: false