-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathazure-pipelines.yml
120 lines (101 loc) · 2.96 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
trigger:
- master
pr:
- master
jobs:
- job: macOS
pool:
vmImage: 'macOS-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.11'
addToPath: true
architecture: 'x64'
displayName: 'Use Python 3.11 explicitly'
- task: NodeTool@0
inputs:
versionSpec: '22.x'
displayName: 'Install Node.js'
- script: npm install
displayName: 'npm install'
- script: npm test
displayName: 'npm test'
- script: npm run build
displayName: 'npm build'
condition:
eq(variables['Build.Reason'], 'PullRequest')
- script: npm run buildAndPublish
displayName: 'npm build and sign'
condition:
ne(variables['Build.Reason'], 'PullRequest')
env:
CSC_KEY_PASSWORD: $(CSC_KEY_PASSWORD_MAC)
CSC_LINK: w3c-certs-mac.p12
APP_PW: $(APP_PW)
APPLE_TEAM_ID: $(APPLE_TEAM_ID)
GH_TOKEN: $(GH_TOKEN)
- task: CopyFiles@2
inputs:
contents: 'dist_electron/w3champions*.dmg'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)
ArtifactName: 'drop'
publishLocation: 'Container'
- job: Windows
pool:
vmImage: 'windows-latest'
demands:
- msbuild
- visualstudio
steps:
- task: NodeTool@0
inputs:
versionSpec: '22.x'
displayName: 'Install Node.js'
- powershell: |
$build=(Get-Content -Raw -Path package.json | ConvertFrom-Json).version
echo "##vso[task.setvariable variable=BUILD_NUMBER;]$build"
displayName: 'set build version'
- script: npm install
displayName: 'npm install'
- script: npm test
displayName: 'npm test'
- script: npm run build
displayName: 'npm build'
condition:
eq(variables['Build.Reason'], 'PullRequest')
# - task: DotNetCoreCLI@2
# inputs:
# command: 'custom'
# custom: 'tool'
# arguments: 'install --global azuresigntool'
# displayName: Install AzureSignTool
# - task: CmdLine@2
# inputs:
# script: AzureSignTool sign -kvu "$(vault-uri)" -kvi "$(app-client-id)" -kvs "$(app-secret-id)" -kvc "w3champions-ov" -kvt "$(app-tenant-id)" -v "dist_electron/w3champions Setup $(BUILD_NUMBER).exe"
# displayName: 'Sign the build'
- task: DownloadSecureFile@1
name: OVCertificate
inputs:
secureFile: w3champions-ov-certificate.pfx
displayName: 'Download OV Cert'
- script: npm run buildAndPublish
displayName: 'electron build & publish'
condition:
ne(variables['Build.Reason'], 'PullRequest')
env:
CSC_KEY_PASSWORD: $(OV_CERT_PASSWORD)
CSC_LINK: $(OVCertificate.secureFilePath)
GH_TOKEN: $(GH_TOKEN)
- task: CopyFiles@2
inputs:
contents: 'dist_electron/w3champions Setup *.exe'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)
ArtifactName: 'drop'
publishLocation: 'Container'