forked from microsoft/vscode-dev-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
51 lines (39 loc) · 1.19 KB
/
azure-pipelines.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
trigger:
branches:
include: ['*']
tags:
include: ['*']
steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.19.1"
- script: |
set -e
yarn
NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
TMP_NAME="$NAME-$VERSION.tgz"
if [[ "$BUILD_SOURCEBRANCH" != refs/tags/* ]]; then
VERSION="$VERSION-${BUILD_SOURCEVERSION:0:8}"
fi
TGZ_NAME="$NAME-$VERSION.tgz"
TGZ_PATH="$SYSTEM_ARTIFACTSDIRECTORY/$TGZ_NAME"
npm pack
mv "$TMP_NAME" "$TGZ_PATH"
echo "##vso[task.setvariable variable=TgzName]$TGZ_NAME"
echo "##vso[task.setvariable variable=TgzPath]$TGZ_PATH"
displayName: Build
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
artifactName: $(TgzName)
targetPath: $(TgzPath)
- task: GitHubRelease@0
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: 'GitHub Connection'
repositoryName: $(Build.Repository.Name)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))