Automatically release when tag is pushed to CI

environments/review-release-ci-s68msn/deployments/1897
Alex Gleason 2022-12-28 19:45:41 -06:00
rodzic fe1135eb9c
commit 44901a5e3e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 32 dodań i 1 usunięć

Wyświetl plik

@ -15,6 +15,7 @@ stages:
- deps
- test
- deploy
- release
deps:
stage: deps
@ -168,4 +169,34 @@ docker:
only:
refs:
- develop
interruptible: true
interruptible: true
# https://docs.gitlab.com/ee/user/project/releases/release_cicd_examples.html#create-release-metadata-in-a-custom-script
prepare-release:
stage: release
rules:
- if: $CI_COMMIT_TAG
script:
- echo "EXTRA_DESCRIPTION=$(npx ts-node ./scripts/changelog.ts $CI_COMMIT_TAG)" >> variables.env
artifacts:
reports:
dotenv: variables.env
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare-release
artifacts: true
rules:
- if: $CI_COMMIT_TAG
script:
- echo "running release"
release:
tag_name: '$CI_COMMIT_TAG'
description: '$EXTRA_DESCRIPTION'
assets:
links:
- name: Build
url: 'https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/$CI_COMMIT_TAG/download?job=build-production'
link_type: package