-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
154 lines (134 loc) · 4.16 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
trigger:
- master
strategy:
matrix:
linux:
imageName: 'ubuntu-18.04'
mac:
imageName: 'macOS-10.14'
windows:
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
steps:
- checkout: self
submodules: true
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'mac.p12'
certPwd: '$(MACP12PASSWORD)'
keychain: 'temp'
deleteCert: true
condition: and(eq( variables['sign'], true ), eq( variables['Agent.OS'], 'Darwin' ))
displayName: Install Apple Signing Certificate
- task: DownloadSecureFile@1
name: signingCertificate
condition: and(eq( variables['sign'], true ), ne( variables['Agent.OS'], 'Darwin' ))
displayName: 'Download Windows & Linux Signing certificate'
inputs:
secureFile: 'windows.pfx'
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
# There should be ENV variables like "JAVA_HOME_11_X64" see https://github.com/microsoft/azure-pipelines-tasks/blob/a24321075eae67b13d0865e4199d5ef82d3effca/Tasks/Common/java-common/java-common.ts#L45
- task: Bash@3
inputs:
targetType: 'inline'
script: 'echo "##vso[task.setvariable variable=JAVA_HOME;]$JAVA_HOME_11_X64"'
displayName: 'Set JAVA_HOME to JDK v11'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
echo "JAVA_HOME=$JAVA_HOME"
java -version
condition: eq(variables['System.Debug'], true)
displayName: 'DEBUG: Show java home and version'
# Temporary disabled caching due to issues on Mac and Linux (executable permissions?)
# https://github.com/durasj/octosign/issues/4
# We should cache ~/.cache too for cypress & electron
#- task: CacheBeta@0
# inputs:
# key: 'npm | $(Agent.OS) | $(Build.SourcesDirectory)/package-lock.json'
# path: $(Pipeline.Workspace)/.npm
# condition: eq( variables['Agent.OS'], 'Windows_NT' )
# displayName: 'Cache node_modules'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'npm install'
displayName: 'Install node modules'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn build:translations'
displayName: 'Build translations'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn test'
displayName: 'Test'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn test:ui'
env:
PERCY_TOKEN: $(PERCY_TOKEN)
condition: eq(variables['Agent.OS'], 'Linux')
displayName: 'Test UI'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn build'
displayName: 'Build'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn build:backends'
displayName: 'Build backends'
- bash: echo "##vso[task.setvariable variable=CSC_LINK]$AGENT_TEMPDIRECTORY/windows.pfx"
condition: and(eq( variables['sign'], true ), ne( variables['Agent.OS'], 'Darwin' ))
displayName: Set CSC_LINK for signing if wanted
- bash: |
echo '##vso[task.setvariable variable=NOTARIZE]1'
condition: and(eq( variables['sign'], true ), eq( variables['Agent.OS'], 'Darwin' ))
displayName: Set NOTARIZE for macOS notarization if wanted
- task: Bash@3
inputs:
targetType: 'inline'
script: yarn dist
env:
GH_TOKEN: $(GH_TOKEN)
CSC_KEY_PASSWORD: $(WINPFXPASSWORD)
APPLEID: $(APPLEID)
APPLEIDPASS: $(APPLEIDPASS)
displayName: 'Create and upload distributables'
# We are currently not able to run smoke test on the Linux
# https://github.com/durasj/octosign/issues/11
#- task: Bash@3
# inputs:
# targetType: 'inline'
# script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y
# condition: eq(variables['Agent.OS'], 'Linux')
# displayName: 'Prepare Linux for smoke test'
#- task: Bash@3
# inputs:
# targetType: 'inline'
# script: 'xvfb-run --auto-servernum --server-args="-screen 0, 1600x900x24" "npm run test:smoke"'
# displayName: 'Run smoke test'
# condition: eq(variables['Agent.OS'], 'Linux')
- task: Bash@3
inputs:
targetType: 'inline'
script: 'yarn test:smoke'
displayName: 'Run smoke test'
condition: ne(variables['Agent.OS'], 'Linux')
- task: Bash@3
inputs:
targetType: 'inline'
script: npx codecov --disable=gcov
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
condition: eq(variables['Agent.OS'], 'Linux')
displayName: 'Upload code coverage'