Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 2945a49

Browse files
committed
Pipelines configuration
1 parent bab4309 commit 2945a49

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

azure-pipelines.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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/'))

0 commit comments

Comments
 (0)