microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev/georgeng/deep_clear

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

pipelines/azure-build-ts.yml

109lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4trigger:
5 branches:
6 include:
7 - main
8
9pr:
10 branches:
11 exclude:
12 - "*"
13
14pool:
15 vmImage: "ubuntu-latest"
16
17variables:
18 - name: buildDirectory
19 value: $(Build.SourcesDirectory)/ts
20 - name: packageDirectory
21 value: $(Build.ArtifactStagingDirectory)/packages
22 - name: publishedPackageDirectory
23 value: $(Build.ArtifactStagingDirectory)/packages/published
24 - name: NpmRcDirectory
25 value: $(Build.SourcesDirectory)
26jobs:
27 - job: build_ts
28 displayName: "Build TypeScript Project"
29 strategy:
30 matrix:
31 node_24:
32 nodeVersion: "24"
33 steps:
34 - template: include-prepare-repo.yml
35 parameters:
36 buildDirectory: $(buildDirectory)
37 nodeVersion: $(nodeVersion)
38 registry: $(REGISTRY)
39
40 - template: include-update-package-version.yml
41 parameters:
42 buildDirectory: $(buildDirectory)
43 prerelease: $(Build.BuildId)
44
45 - script: |
46 npm run build
47 displayName: "Build"
48 workingDirectory: $(buildDirectory)
49
50 - script: |
51 pnpm pack --filter @typeagent/* --pack-destination $(publishedPackageDirectory)
52 displayName: "Pack Published packages"
53 workingDirectory: $(buildDirectory)
54
55 - script: |
56 pnpm pack --filter=\!@typeagent/* --pack-destination $(packageDirectory)
57 displayName: "Pack Non-published packages"
58 workingDirectory: $(buildDirectory)
59
60 - publish: $(packageDirectory)
61 artifact: Packages
62
63 - script: |
64 sudo apt install libsecret-1-0
65 displayName: "Install libsecret-1-0"
66 condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
67
68 - script: |
69 npm run test:local
70 displayName: "Run Tests (Local)"
71 workingDirectory: $(buildDirectory)
72
73 - script: |
74 Xvfb :99 -screen 0 1600x1200x24 &
75 export DISPLAY=:99
76 npm run test:ui
77 displayName: "UI tests (requires display)"
78 condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
79 workingDirectory: $(buildDirectory)
80
81 - script: |
82 npm run lint
83 displayName: "Lint"
84 workingDirectory: $(buildDirectory)
85
86 - script: |
87 npm run check:policy
88 displayName: "Check Policy"
89 workingDirectory: $(buildDirectory)
90
91 - script: |
92 echo $(ADO_REGISTRY)
93 echo "registry=$(ADO_REGISTRY)" > .npmrc
94 cat .npmrc
95 displayName: "Create .npmrc file."
96 workingDirectory: $(NpmRcDirectory)
97
98 - task: npmAuthenticate@0
99 inputs:
100 workingFile: "$(NpmRcDirectory)/.npmrc"
101 displayName: "Authenticate with Azure Artifacts"
102
103 - script: |
104 for file in $(publishedPackageDirectory)/*.tgz; do
105 echo "Publishing file: $file"
106 npm publish --registry=$(ADO_REGISTRY) --tag=latest "$file"
107 done
108 displayName: "Publish packages"
109 workingDirectory: $(NpmRcDirectory)
110