-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
49 lines (45 loc) · 1.29 KB
/
.gitlab-ci.yml
File metadata and controls
49 lines (45 loc) · 1.29 KB
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
image: $IMAGE
stages:
- version
- publish
version:
stage: version
script:
- 'release next-version --allow-current'
- 'release next-version --allow-current > .next-version'
- 'echo "RELEASE_SHA=$CI_COMMIT_SHA" > build_info'
- 'echo "RELEASE_VERSION=$(cat .next-version)" >> build_info'
- 'cat build_info'
- '. build_info'
- 'echo $RELEASE_VERSION'
artifacts:
paths:
- build_info
publish_develop:
stage: publish
script:
- '. build_info'
- 'echo New version is: $RELEASE_VERSION'
- export PREVIOUS_VERSION=$(jq -r '.version' package.json)
- 'echo Previous version in package.json: $PREVIOUS_VERSION'
- 'sed -i s/$PREVIOUS_VERSION/$RELEASE_VERSION/g package.json'
- 'release changelog'
- 'release commit-and-tag CHANGELOG.md build_info package.json'
- 'npm-publish --token=$NPM_TOKEN --tag next'
only:
- develop
when: manual
publish_main:
stage: publish
script:
- '. build_info'
- 'echo New version is: $RELEASE_VERSION'
- export PREVIOUS_VERSION=$(jq -r '.version' package.json)
- 'echo Previous version in package.json: $PREVIOUS_VERSION'
- 'sed -i s/$PREVIOUS_VERSION/$RELEASE_VERSION/g package.json'
- 'release changelog'
- 'release commit-and-tag CHANGELOG.md build_info package.json'
- 'npm-publish --token=$NPM_TOKEN'
only:
- main
when: manual