diff options
-rw-r--r-- | .gitlab-ci.yml | 16 | ||||
-rw-r--r-- | scripts/create_release.rb | 41 |
2 files changed, 57 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45de5ce61c6..eefbfc7ceb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,7 @@ stages: - test - post-test - pages + - release - post-cleanup # Predefined scopes @@ -879,6 +880,21 @@ pages: - master@gitlab-org/gitlab-ce - master@gitlab-org/gitlab-ee +## +# Create a release note +# You can check it in https://gitlab.com/gitlab-org/gitlab-ce/releases +release: + <<: *dedicated-no-docs-no-db-pull-cache-job + before_script: [] + stage: release + script: + - ./scripts/create_release.rb + only: + refs: + - tags@gitlab-org/gitlab-ce + variables: + - $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+\$/ + # Insurance in case a gem needed by one of our releases gets yanked from # rubygems.org in the future. cache gems: diff --git a/scripts/create_release.rb b/scripts/create_release.rb new file mode 100644 index 00000000000..29dfe0a2bb4 --- /dev/null +++ b/scripts/create_release.rb @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +class Release + attr_reader :edition, :tag + + def initialize(edition, tag) + @edition = edition + @tag = tag + end + + def valid? + /^$/.match(tag) && /^$/.match(previous_tag) + end + + def create + return unless valied? + + # curl --header 'Content-Type: application/json' \ + # --header "PRIVATE-TOKEN: $GITLAB_RELEASE_API_TOKEN" \ + # --data '{ "name": "${name}", "tag_name": "${tag_name}", "description": "${changelog}" }' \ + # --request POST \ + # http://gitlab.com/api/v4/projects/$CI_PROJECT_ID/releases + end + + private + + def previous_release + + end + + def changelog_path + './CHANGELOG.md' + end + + def changelog_diff + + end +end + +Release.new("CE", ENV['CI_COMMIT_TAG']).create |