-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
47 lines (42 loc) · 1.1 KB
/
bitbucket-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
image: node:16.11.1-buster
clone:
depth: full
definitions:
steps:
- step: &test
name: Test
script:
- npm ci
- npm run lint
- npm run test
- step: &release
name: Publish
script:
- git fetch
- git checkout main
- VERSION=$(echo $BITBUCKET_TAG | sed 's/^.*[A-Za-z]-//g')
- npm version $VERSION --allow-same-version
- git config --global user.name "Automated NPM Release"
- git config --global user.email "[email protected]"
- git push origin main
- git push --delete origin release-${VERSION}
- git tag -d release-${VERSION}
- git push --tags
- step: &publish
name: Publish
script:
- npm ci
- npm run build
- pipe: atlassian/npm-publish:0.3.3
variables:
NPM_TOKEN: $NPM_TOKEN
EXTRA_ARGS: "--access public"
pipelines:
pull-requests:
"**":
- step: *test
tags:
release-*:
- step: *release
v*:
- step: *publish