This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
azure-pipelines-task-build.yml
63 lines (48 loc) · 1.95 KB
/
azure-pipelines-task-build.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
parameters:
tasksDirectory: Tasks
taskName:
steps:
# Update package vertions
- script: |
# Display command output and fail immediately on any errors
set -e -x
# Set the package version
sed -i -E 's/"version":\s"[0-9/.]+"/"version": "$(GitVersion.MajorMinorPatch)"/g' package.json
# Set the task version
sed -i -E 's/"Major":\s[0-9]+/"Major": $(GitVersion.Major)/g' task.json
sed -i -E 's/"Minor":\s[0-9]+/"Minor": $(GitVersion.Minor)/g' task.json
sed -i -E 's/"Patch":\s[0-9]+/"Patch": $(GitVersion.Patch)/g' task.json
cat task.json
workingDirectory: ./${{ parameters.tasksDirectory }}/${{ parameters.taskName }}
displayName: Set versions for the ${{ parameters.taskName }} task
# Built and test the extension
- script: |
# Display command output and fail immediately on any errors
set -e -x
# Install NPM Packages
npm install --dev
# Build typescript
tsc --build
# Run tests
workingDirectory: ./${{ parameters.tasksDirectory }}/${{ parameters.taskName }}
displayName: Build and test the ${{ parameters.taskName }} task
# Prune and copy files to the artifact staging directory
- script: |
# Display command output and fail immediately on any errors
set -e -x
# Remove all dev dependencies prior to release
npm prune --production
# Ensure the destination path exists
mkdir -p $(Build.StagingDirectory)/Tasks/
# Copy all task files to the staging output path
rsync -avr \
--include=.bin/*** \
--include=node_modules/*** \
--include=package.json \
--include=package-lock.json \
--include=task.json \
--include=icon.png \
--exclude=* \
./ $(Build.StagingDirectory)/Tasks/${{ parameters.taskName }}
workingDirectory: ./${{ parameters.tasksDirectory }}/${{ parameters.taskName }}
displayName: Package the ${{ parameters.taskName }} task for release