forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.release-publish.yml
More file actions
158 lines (148 loc) · 5.49 KB
/
azure-pipelines.release-publish.yml
File metadata and controls
158 lines (148 loc) · 5.49 KB
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
155
156
157
158
trigger: none
pr: none
parameters:
- name: _REMINDER
displayName: Review & undraft the release at https://github.com/microsoft/TypeScript/releases once it appears!
type: boolean
default: true
- name: PUBLISH_TAG
displayName: npm publish tag
default: dev
values:
- dev
- beta
- rc
- latest
- name: RELEASE_TITLE_NAME
displayName: GitHub release title name
default: 0.0.0 Test
- name: TAG_NAME
displayName: Git tag name
default: v0.0.0-SetMe
variables:
- name: PUBLISH_TAG
value: ${{ parameters.PUBLISH_TAG }}
- name: RELEASE_TITLE_NAME
value: ${{ parameters.RELEASE_TITLE_NAME }}
- name: TAG_NAME
value: ${{ parameters.TAG_NAME }}
resources:
pipelines:
- pipeline: 'tgz'
project: 'TypeScript'
source: 'Release\TypeScript Release'
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: TypeScript-AzurePipelines-EO
image: 1ESPT-AzureLinux3
os: linux
sdl:
sourceAnalysisPool:
name: TypeScript-AzurePipelines-EO
image: 1ESPT-Windows2022
os: windows
stages:
- stage: Publish
displayName: Publish
jobs:
- job: tarball
displayName: Publish tarball
condition: succeeded()
timeoutInMinutes: 0
templateContext:
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: 'tgz'
artifactName: 'tgz'
targetPath: '$(Pipeline.Workspace)/tgz'
steps:
- checkout: none
- task: NodeTool@0
inputs:
versionSpec: 20.x
displayName: 'Install Node'
- task: CmdLine@2
displayName: Copy versioned drop to typescript.tgz
inputs:
script: |
pushd $(Pipeline.Workspace)/tgz
ls -lhR
cp typescript-*.tgz typescript.tgz
- task: Npm@1
displayName: npm publish tarball
inputs:
command: custom
workingDir: $(Pipeline.Workspace)/tgz
verbose: false
customCommand: publish $(Pipeline.Workspace)/tgz/typescript.tgz --tag $(PUBLISH_TAG)
# This must match the service connection name.
customEndpoint: Typescript NPM
publishEndpoint: Typescript NPM
- job: github
displayName: Create github release
dependsOn: tarball
condition: succeeded()
timeoutInMinutes: 0
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: 'tgz'
artifactName: 'tgz'
targetPath: '$(Pipeline.Workspace)/tgz'
steps:
- checkout: none
- task: NodeTool@0
inputs:
versionSpec: 20.x
displayName: 'Install Node'
- task: CmdLine@2
displayName: Get commit hash
inputs:
script: |
# Read package.json and get gitHead
pushd $(Pipeline.Workspace)/tgz
ls -lhR
tar -zxvf typescript-*.tgz
cd package
GIT_COMMIT_HASH=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json', 'utf-8')).gitHead)")
if [ -z "$GIT_COMMIT_HASH" ]; then
echo "Failed to get git commit hash from package.json"
exit 1
fi
echo "##vso[task.setvariable variable=GIT_COMMIT_HASH]$GIT_COMMIT_HASH"
echo "Git commit hash: $GIT_COMMIT_HASH"
- task: GitHubRelease@1
displayName: GitHub release (create)
inputs:
# This must match the service connection name.
gitHubConnection: typescript-bot connection
repositoryName: microsoft/TypeScript
tagSource: userSpecifiedTag
tag: $(TAG_NAME)
title: TypeScript $(RELEASE_TITLE_NAME)
target: $(GIT_COMMIT_HASH)
releaseNotesSource: inline
releaseNotesInline: |
<!---
For release notes, check out the [release announcement]().
For new features, check out the [What's new in TypeScript $(TAG_NAME)]().
For the complete list of fixed issues, check out the
* [fixed issues query for TypeScript $(TAG_NAME)](https://github.com/microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A%22TypeScript+3.3%22+is%3Aclosed+).
Downloads are available on:
* [npm](https://www.npmjs.com/package/typescript)
-->
assets: $(Pipeline.Workspace)/tgz/**/typescript-*.tgz
isDraft: ${{ not(eq(parameters.PUBLISH_TAG, 'latest')) }}
addChangeLog: false