-
Notifications
You must be signed in to change notification settings - Fork 164
/
ci.yml
117 lines (95 loc) · 3.32 KB
/
ci.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
# Continuous Integration
trigger:
- main
pr: none
jobs:
- job: npm_stable
displayName: Npm publish
pool:
vmImage: windows-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: 16.14.2
displayName: Install Node.js
- task: UseDotNet@2
inputs:
version: 6.0.x
- script: echo '##vso[task.setvariable variable=CADL_VS_CI_BUILD;]true'
displayName: Enable official Visual Studio extension build
- script: npx @microsoft/rush install
displayName: Install JavaScript Dependencies
- script: dotnet restore
displayName: Restore .NET Dependencies
workingDirectory: packages/cadl-vs
- script: npx @microsoft/rush rebuild --verbose
displayName: Build
- script: npx @microsoft/rush test-official
displayName: Test
- template: ./upload-coverage.yml
- script: |
set NPM_AUTH_TOKEN=$(azure-sdk-npm-token)
node common/scripts/install-run-rush.js publish --publish --include-all --set-access-level public
displayName: Release
- task: AzureFileCopy@4
inputs:
sourcePath: "packages/playground/dist/*"
azureSubscription: "Azure SDK Playground"
destination: "AzureBlob"
storage: "cadlplayground"
containerName: "$web"
displayName: "Update playground"
- task: AzureFileCopy@4
inputs:
sourcePath: "packages/website/dist/*"
azureSubscription: "Azure SDK Playground"
destination: "AzureBlob"
storage: "cadlwebsite"
containerName: "$web"
displayName: "Update website"
- job: npm_dev
dependsOn: npm_stable
displayName: Npm publish dev version
pool:
vmImage: windows-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: 16.14.2
displayName: Install Node.js
- script: echo '##vso[task.setvariable variable=CADL_VS_CI_BUILD;]true'
displayName: Enable official Visual Studio extension build
- script: npx @microsoft/rush install
displayName: Install JavaScript Dependencies
- script: dotnet restore
displayName: Restore .NET Dependencies
workingDirectory: packages/cadl-vs
- script: npx @microsoft/rush rebuild --verbose
displayName: Build
- script: node ./packages/internal-build-utils/cmd/cli.js bump-version-preview .
displayName: Bump version to prerelease targets
- script: |
set NPM_AUTH_TOKEN=$(azure-sdk-npm-token)
node common/scripts/install-run-rush.js publish --publish --include-all --set-access-level public --tag next
displayName: Release
- job: docker
displayName: Docker build and publish
variables:
imageName: "azsdkengsys.azurecr.io/cadl"
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@1
displayName: login
inputs:
azureSubscriptionEndpoint: "AzureSDKEngKeyVault Secrets"
azureContainerRegistry: azsdkengsys.azurecr.io
command: login
- script: |
docker build -f ./docker/Dockerfile \
-t $(imageName):latest \
-t $(imageName):alpine \
.
displayName: "Build"
- script: docker push $(imageName) --all-tags
displayName: "Push"