-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines.yml
64 lines (62 loc) · 2.49 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
# Caching is not supported yet, even though Azure supports it. The only
# problem, for whatever reason Rust does not use the cached target/ directory
# and compiles everything anyway. Also, downloading the 1GB cache takes a good
# minute by itself so it's not that important.
trigger:
branches:
include: ['*']
tags:
include: ['*']
stages:
- stage: Build
jobs:
- job: Build
steps:
- template: continuous-integration/install-rust.yaml
- template: continuous-integration/install-binaryen.yaml
- template: continuous-integration/install-wasmbindgen.yaml
- template: continuous-integration/install-wasmpack.yaml
- script: ./build.sh
displayName: Build
- job: Format
steps:
- template: continuous-integration/install-rust.yaml
- script: cargo fmt --all -- --check
displayName: Cargo Fmt
- job: Lint
steps:
- template: continuous-integration/install-rust.yaml
- script: cargo clippy --all -- -D warnings
displayName: Cargo Clippy
- stage: Release
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
jobs:
- job: Verify
steps:
- script: '[[ `cat CHANGELOG.md` == "## $(Build.SourceBranchName)"* ]]'
displayName: Verify changelog was updated
- script: '[[ `sed "3q;d" Cargo.toml` = "version = \"$(Build.SourceBranchName)"* ]]'
displayName: Verify Cargo.toml was updated
- job: Deploy
dependsOn: Verify
steps:
- template: continuous-integration/install-rust.yaml
- template: continuous-integration/install-binaryen.yaml
- template: continuous-integration/install-wasmbindgen.yaml
- template: continuous-integration/install-wasmpack.yaml
- script: sudo npm install -g vsce
displayName: Install dependencies (vsce)
- script: BUILDSH_RELEASE=1 ./build.sh package
displayName: Package extension
- script: sed '/##/q' <(tail CHANGELOG.md -n +3) | head -n -2 > github-release-changelog-diff.md
displayName: Prepare changelog
- task: GitHubRelease@0
displayName: Deploy to GitHub
inputs:
gitHubConnection: github/pustaczek
repositoryName: pustaczek/icie
releaseNotesFile: github-release-changelog-diff.md
assets: target/evscode/icie-*.vsix
addChangeLog: false
- script: vsce publish --pat $(VSMARKETPLACE_PAT) --packagePath target/evscode/icie-*.vsix
displayName: Deploy to VS Marketplace