-
Notifications
You must be signed in to change notification settings - Fork 38
/
base_semantic_release_stage.yml
33 lines (31 loc) · 1.1 KB
/
base_semantic_release_stage.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
#
variables:
GIT_AUTHOR_EMAIL: 45039513+SocialGroovyBot@users.noreply.github.com
GIT_AUTHOR_NAME: Social Groovy Bot
GIT_COMMITTER_EMAIL: $GIT_AUTHOR_EMAIL
GIT_COMMITTER_NAME: $GIT_AUTHOR_NAME
#
# Additional plugins
SEMANTIC_RELEASE_PLUGINS: "@semantic-release/changelog @semantic-release/git"
SEMANTIC_RELEASE_ARGS: ""
.base_semantic_release_stage:
stage: "Release"
image: node:16.13-stretch
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $CI_PROJECT_DIR/.yarn
before_script:
# Use github as origin
- git remote set-url origin https://${GITHUB_TOKEN}@github.com/${CI_PROJECT_ROOT_NAMESPACE}/${CI_PROJECT_TITLE}.git
script:
# Set git to a branch
- git checkout ${CI_COMMIT_REF_NAME}
# Use local yarn cache
- yarn config set cache-folder $CI_PROJECT_DIR/.yarn
# Install semantic-release
- echo "yarn global add semantic-release $SEMANTIC_RELEASE_PLUGINS"
- yarn global add semantic-release $SEMANTIC_RELEASE_PLUGINS
# Run semantic-release
- echo "semantic-release $SEMANTIC_RELEASE_ARGS"
- semantic-release $SEMANTIC_RELEASE_ARGS