-
Notifications
You must be signed in to change notification settings - Fork 258
/
Copy pathpublish.yml
97 lines (94 loc) · 4.06 KB
/
publish.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
trigger: none # We don't want CI builds, just a manual release process
parameters:
- name: doRelease
displayName: Push the Playwright Release to NuGet.org
default: false
type: boolean
- name: doReleaseCLI
displayName: Push the CLI Release to NuGet.org
default: false
type: boolean
variables:
- name: BuildConfiguration
value: 'Release'
- name: TeamName
value: Playwright
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
# https://aka.ms/MicroBuild
name: VSEngSS-MicroBuild2022-1ES
os: windows
sdl:
suppression:
suppressionFile: $(Build.SourcesDirectory)\.azure-pipelines\guardian\SDL\.gdnsuppress
stages:
- stage: BuildPackageSignPublish
displayName: Build, Package, Sign, Publish
jobs:
- job: Build
displayName: Build
steps:
- task: UseDotNet@2
displayName: 'Use .NET 8 SDK'
inputs:
packageType: sdk
version: 8.x
- task: MicroBuildSigningPlugin@4
inputs:
signType: real
feedSource: 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
# We need to download the driver first, so we can build
- task: DotNetCoreCLI@2
displayName: Download the driver
inputs:
command: 'run'
arguments: '--project $(Build.SourcesDirectory)/src/tools/Playwright.Tooling/Playwright.Tooling.csproj -- download-drivers --basepath $(Build.SourcesDirectory)'
- task: DotNetCoreCLI@2
displayName: Build Playwright NuGet Packages
inputs:
command: 'build'
projects: src
arguments: '-c $(BuildConfiguration)'
# This (dotnet pack) will internally sign it via the MicroBuildSigningPlugin
- task: DotNetCoreCLI@2
displayName: Pack Playwright NuGet Packages
inputs:
command: 'pack'
packagesToPack: |
src/Playwright.CLI/Playwright.CLI.csproj;
src/Playwright/Playwright.csproj;
src/Playwright.NUnit/Playwright.NUnit.csproj;
src/Playwright.MSTest/Playwright.MSTest.csproj;
src/Playwright.TestAdapter/Playwright.TestAdapter.csproj;
packDirectory: '$(Build.ArtifactStagingDirectory)/nuget'
versioningScheme: 'off'
- task: 1ES.PublishNuget@1
displayName: Publish Microsoft.Playwright{NUnit,MSTest,TestAdapter}
condition: eq('${{parameters.doRelease}}', true)
inputs:
useDotNetTask: false
# The reason for the 1.* after the package name is that we know the end of the package name in order to not
# match with e.g. Microsoft.Playwright.CLI when we only want to match Microsoft.Playwright.
# Semicolon separated as per https://portal.microsofticm.com/imp/v5/incidents/details/467483180/summary
packagesToPush: $(Build.ArtifactStagingDirectory)/nuget/Microsoft.Playwright.1.*.nupkg;$(Build.ArtifactStagingDirectory)/nuget/Microsoft.Playwright.MSTest.1.*.nupkg;$(Build.ArtifactStagingDirectory)/nuget/Microsoft.Playwright.NUnit.1.*.nupkg;$(Build.ArtifactStagingDirectory)/nuget/Microsoft.Playwright.TestAdapter.1.*.nupkg
packageParentPath: '$(Build.ArtifactStagingDirectory)'
nuGetFeedType: external
publishFeedCredentials: 'NuGet-Playwright'
- task: 1ES.PublishNuget@1
displayName: Publish Microsoft.Playwright.CLI
condition: eq('${{parameters.doReleaseCLI}}', true)
inputs:
useDotNetTask: false
packagesToPush: '$(Build.ArtifactStagingDirectory)/nuget/Microsoft.Playwright.CLI.1.*.nupkg'
packageParentPath: '$(Build.ArtifactStagingDirectory)'
nuGetFeedType: external
publishFeedCredentials: 'NuGet-Playwright'
- task: MicroBuildCleanup@1