-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
87 lines (75 loc) · 2.25 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
85
86
87
variables:
- name: node_version
value: '16.x'
jobs:
- job: Test
strategy:
matrix:
Linux:
image_name: ubuntu-latest
Mac:
image_name: macOS-latest
Windows:
image_name: windows-latest
pool:
vmImage: $(image_name)
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js $(node_version)'
- script: npm ci
displayName: Install dependencies
# Some of the following are only run on Linux to avoid duplication
- script: npm run lint
condition: eq(variables['agent.os'], 'Linux')
displayName: Run linting
- script: npm run test:cover
displayName: Run Node tests
- script: bash <(curl -s https://codecov.io/bash)
condition: and(succeeded(), eq(variables['agent.os'], 'Linux'))
displayName: Upload coverage
- script: |
set -e
make image
docker run stencila/jesta
condition: and(succeeded(), eq(variables['agent.os'], 'Linux'))
displayName: Build and run Docker image
- job: Release
dependsOn: [Test]
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: Install Node.js
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- script: |
set -e
npm ci
mkdir -p docs
npx semantic-release
env:
GIT_AUTHOR_NAME: Stencila CI Bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Stencila CI Bot
GIT_COMMITTER_EMAIL: [email protected]
GITHUB_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(NPM_TOKEN)
displayName: Release package
- task: gitversion/execute@0
displayName: Determine version
- task: Docker@2
displayName: Build and push Docker image
inputs:
command: buildAndPush
containerRegistry: DockerHub
repository: stencila/jesta
tags: |
$(GitVersion.SemVer)
latest