/
azure-pipelines.yml
138 lines (133 loc) · 4.28 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Docker image
# Build a Docker image to run, deploy, or push to a container registry.
# Add steps that use Docker Compose, tag images, push to a registry, run an image, and more:
# https://docs.microsoft.com/vsts/pipelines/languages/docker
name: $(Build.SourceVersion)
jobs:
- job: Linux
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.15.0'
- script: node --version
displayName: node --version
- script: node scripts/replaceCommitVersion.js
displayName: replace commit
- script: docker build -t alpine-fastpack linux-build
displayName: 'docker build'
- script: docker run --rm --mount src=`pwd`,target=/fastpack,type=bind alpine-fastpack /bin/bash -c 'cd /fastpack && make install && make test && make setup-test && make test-integration && make build && ldd _build/default/bin/fpack.exe'
displayName: 'make all'
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'vendor-linux-fpack.exe'
pathToPublish: '_build/default/bin/fpack.exe'
- job: MacOS
pool:
vmImage: 'macOS 10.13'
variables:
TRAVIS_OS_NAME: osx
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.15.0'
- script: node --version
displayName: node --version
- script: node scripts/replaceCommitVersion.js
displayName: replace commit
- script: npm install -g yarn
displayName: install Yarn
- script: npm install -g esy@0.5.7
displayName: install esy
- script: make install
displayName: make install
- script: make test
displayName: make test
- script: make setup-test
displayName: make setup-test
- script: make test-integration
displayName: make test-integration
- script: make build
displayName: make build (release)
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'vendor-darwin-fpack.exe'
pathToPublish: '_build/default/bin/fpack.exe'
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.15.0'
- script: node --version
displayName: node --version
- script: node scripts/replaceCommitVersion.js
displayName: replace commit
- script: npm install -g yarn
displayName: install Yarn
- script: npm install -g esy@0.5.7
displayName: install esy
- script: esy install
displayName: esy install
continueOnError: true
- script: esy install
displayName: esy install
continueOnError: true
- script: esy install
displayName: esy install
- script: esy b jbuilder build --dev bin/fpack.exe
displayName: build-dev
- script: node -r ./_esy/default/pnp.js scripts/setupTest.js
displayName: setup tests
- script: node -r ./_esy/default/pnp.js scripts/test.js --no-color
displayName: Integration Tests
continueOnError: true
- script: node -r ./_esy/default/pnp.js scripts/test.js --no-color
displayName: Integration Tests (retry)
continueOnError: true
- task: PublishBuildArtifacts@1
inputs:
artifactName: 'vendor-win32-fpack.exe'
pathToPublish: '_build/default/bin/fpack.exe'
- job: Package
dependsOn:
- Linux
- MacOS
- Windows
condition: succeeded()
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: DownloadBuildArtifacts@0
displayName: download osx binary
inputs:
artifactName: 'vendor-darwin-fpack.exe'
downloadPath: .
- script: cp -R vendor-darwin-fpack.exe/fpack.exe dist/vendor-darwin
displayName: copy osx binary
- task: DownloadBuildArtifacts@0
displayName: download linux binary
inputs:
artifactName: 'vendor-linux-fpack.exe'
downloadPath: .
- script: cp -R vendor-linux-fpack.exe/fpack.exe dist/vendor-linux
displayName: copy linux binary
- task: DownloadBuildArtifacts@0
displayName: download windows binary
inputs:
artifactName: 'vendor-win32-fpack.exe'
downloadPath: .
- script: cp -R vendor-win32-fpack.exe/fpack.exe dist/vendor-win32
displayName: copy windows binary
- script: cp -R node-service README.md dist
displayName: copy node-service & README
- script: chmod +x dist/vendor-*/*.exe
displayName: add executable permissions
- script: "cp -R dist fpack && tar -czf fpack.tgz fpack"
displayName: create *.tgz to keep permissions
- task: PublishBuildArtifacts@1
inputs:
artifactName: fpack.tgz
pathToPublish: fpack.tgz