-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
79 lines (74 loc) · 2.16 KB
/
.gitlab-ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
image: hacksawgaming/hacksaw-build:4.2.1-1
stages:
- test
- release
- mergeback
test:
stage: test
before_script:
- yarn
script:
- npm test
except:
refs:
- tags
variables:
- $CI_COMMIT_MESSAGE =~ /^\d+\.\d+\.\d+/
- $CI_COMMIT_MESSAGE =~ /^Update (package from master|version)$/m
package_release:
stage: release
before_script:
- yarn
- git config --global user.email "[email protected]"
- git config --global user.name "CI"
script:
- npx @hacksawstudios/gitlab-ci-releaser --npm
- yarn
- git add .
- git commit -m "Update version"
- git push --follow-tags "https://${GITLAB_USER_NAME}:${GITLAB_CI_RELEASER_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:master"
only:
refs:
- master
- /^patch_.*$/
except:
variables:
- $CI_COMMIT_MESSAGE =~ /^\d+\.\d+\.\d+$/m
- $CI_COMMIT_MESSAGE =~ /^Update (package from master|version)$/m
package_rc:
stage: release
before_script:
- yarn
- git config --global user.email "[email protected]"
- git config --global user.name "CI"
script:
- npx @hacksawstudios/gitlab-ci-releaser --npm --preid rc
- yarn
- git add .
- git commit -m "Update version"
- git push "https://${GITLAB_USER_NAME}:${GITLAB_CI_RELEASER_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:develop"
only:
- develop
except:
variables:
- $CI_COMMIT_MESSAGE =~ /^\d+\.\d+\.\d+(?:-rc\.[0-9]+)?/
- $CI_COMMIT_MESSAGE =~ /^Update (package from master|version)$/m
merge_back:
stage: mergeback
before_script:
- yarn
- git config --global user.email "[email protected]"
- git config --global user.name "CI"
script:
- git add .
- git commit -m "Update version"
- git fetch
- git checkout origin/develop
- git merge origin/master -X theirs
- npm version preminor --preid=rc -m "Update package from master"
- git push "https://${GITLAB_USER_NAME}:${GITLAB_CI_RELEASER_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:develop"
only:
refs:
- tags
variables:
- $CI_COMMIT_MESSAGE =~ /^\d+\.\d+\.\d+$/m