This repository was archived by the owner on Nov 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ trigger :
2
+ branches :
3
+ include : ['*']
4
+ tags :
5
+ include : ['*']
6
+
7
+ steps :
8
+ - task : NodeTool@0
9
+ inputs :
10
+ versionSpec : " 10.15.1"
11
+
12
+ - script : |
13
+ set -e
14
+
15
+ NAME=$(node -p "require('./package.json').name")
16
+ VERSION=$(node -p "require('./package.json').version")
17
+
18
+ TMP_NAME="$NAME-$VERSION.tgz"
19
+
20
+ if [[ "$BUILD_SOURCEBRANCH" != refs/tags/* ]]; then
21
+ VERSION="$VERSION-${BUILD_SOURCEVERSION:0:8}"
22
+ fi
23
+
24
+ TGZ_NAME="$NAME-$VERSION.tgz"
25
+ TGZ_PATH="$SYSTEM_ARTIFACTSDIRECTORY/$TGZ_NAME"
26
+
27
+ npm pack
28
+ mv "$TMP_NAME" "$TGZ_PATH"
29
+
30
+ echo "##vso[task.setvariable variable=TgzName]$TGZ_NAME"
31
+ echo "##vso[task.setvariable variable=TgzPath]$TGZ_PATH"
32
+ displayName : Build
33
+
34
+ - task : PublishPipelineArtifact@0
35
+ displayName : ' Publish Pipeline Artifact'
36
+ inputs :
37
+ artifactName : $(TgzName)
38
+ targetPath : $(TgzPath)
39
+
40
+ - task : GitHubRelease@0
41
+ displayName : ' Create GitHub Release'
42
+ inputs :
43
+ gitHubConnection : ' GitHub Connection'
44
+ repositoryName : $(Build.Repository.Name)
45
+ condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
You can’t perform that action at this time.
0 commit comments