Skip to content

Commit 77a0d57

Browse files
cliedemanchristophwitzko
authored andcommitted
docs: Added gitlab CI integration docs
1 parent addfcbe commit 77a0d57

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,31 @@ branches:
121121
- /^v\d+\.\d+\.\d+$/
122122
```
123123
124+
## Example GitLab CI Config
125+
126+
### GitLab token
127+
It is necessary to create a new Gitlab personal access token with the `api` scope [here](https://gitlab.com/profile/personal_access_tokens).
128+
Ensure the CI variable is protected and masked as the `GITLAB_TOKEN` has a lot of rights. There is an open issue for project specific [tokens](https://gitlab.com/gitlab-org/gitlab/issues/756)
129+
You can set the GitLab token via the `GITLAB_TOKEN` environment variable or the `-token` flag.
130+
131+
.gitlab-ci.yml
132+
```yml
133+
stages:
134+
# other stages
135+
- release
136+
137+
release:
138+
image: registry.gitlab.com/go-semantic-release/semantic-release:latest # Replace this with the current release
139+
stage: release
140+
# Remove this if you want a release created for each push to master
141+
when: manual
142+
only:
143+
- master
144+
script:
145+
- release
146+
```
147+
148+
124149
## Beta release support
125150
Beta release support empowers you to release beta, rc, etc. versions with `semantic-release` (e.g. v2.0.0-beta.1). To enable this feature you need to create a new branch (e.g. beta/v2) and check in a `.semrelrc` file with the following content:
126151
```

0 commit comments

Comments
 (0)