blob: 29dfe0a2bb4a620d46a15412ad02ce2ea0cd2b59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
|