Skip to content

Commit 78d4a5f

Browse files
docs: add GitLab go example
1 parent a713764 commit 78d4a5f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,35 @@ release:
119119
- semantic-release # Add --allow-no-changes if you want to create a release for each push
120120
```
121121

122+
### Releasing a Go application with GitLab CI
123+
The full example can be found at https://gitlab.com/go-semantic-release/example-go-application.
124+
125+
Example [.gitlab-ci.yml](https://gitlab.com/go-semantic-release/example-go-application/-/blob/main/.gitlab-ci.yml) config:
126+
```yaml
127+
image: golang:1.19
128+
129+
stages:
130+
- test
131+
- release
132+
133+
test:
134+
stage: test
135+
except:
136+
- tags
137+
script:
138+
- go test -v ./...
139+
- go build ./
140+
- ./example-go-application
141+
142+
release:
143+
stage: release
144+
only:
145+
- main
146+
script:
147+
- curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release && chmod +x ./semantic-release
148+
- ./semantic-release --hooks goreleaser
149+
```
150+
122151
## Plugin System
123152

124153
Since v2, semantic-release is equipped with a plugin system. The plugins are standalone binaries that use [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) as a plugin library. `semantic-release` automatically downloads the necessary plugins if they don't exist locally. The plugins are stored in the `.semrel` directory of the current working directory in the following format: `.semrel/<os>_<arch>/<plugin name>/<version>/`. The go-semantic-release plugins registry (https://registry.go-semantic-release.xyz/) is used to resolve plugins and to download the correct binary. With the new [plugin-registry](https://github.com/go-semantic-release/plugin-registry) service the API also supports batch requests to resolve multiple plugins at once and caching of the plugins.

0 commit comments

Comments
 (0)