ci: add release job
This commit is contained in:
@@ -6,6 +6,8 @@ image: golang:1.19.5
|
|||||||
stages:
|
stages:
|
||||||
- deps
|
- deps
|
||||||
- test
|
- test
|
||||||
|
- prepare
|
||||||
|
- release
|
||||||
|
|
||||||
run-pre-commit:
|
run-pre-commit:
|
||||||
stage: .pre
|
stage: .pre
|
||||||
@@ -44,3 +46,30 @@ vulnerabilities:
|
|||||||
script:
|
script:
|
||||||
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
- govulncheck ./...
|
- govulncheck ./...
|
||||||
|
|
||||||
|
prepare_release:
|
||||||
|
image: node:18
|
||||||
|
stage: prepare
|
||||||
|
before_script:
|
||||||
|
- npm install -g conventional-changelog-cli
|
||||||
|
script:
|
||||||
|
- echo "DESCRIPTION=$(conventional-changelog -p conventionalcommits)" > variables.env
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
dotenv: variables.env
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
stage: release
|
||||||
|
needs:
|
||||||
|
- job: prepare_release
|
||||||
|
artifacts: true
|
||||||
|
script:
|
||||||
|
- echo "Running release_job for $TAG"
|
||||||
|
release:
|
||||||
|
tag_name: '$CI_COMMIT_TAG'
|
||||||
|
description: '$DESCRIPTION'
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
|||||||
Reference in New Issue
Block a user