gitlab_awesome_release 0.1.0.beta8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 355a9cb73d304418f9b01cc42e12fad653563244
4
- data.tar.gz: 0ef0e30cefce4d31f54b989d4f943b5b25b56c1f
3
+ metadata.gz: 275b6a408d136a5640c4c80d0798947403c1584c
4
+ data.tar.gz: 8abbbd924954996a5f53338d69a598753569000b
5
5
  SHA512:
6
- metadata.gz: acb6ea4023c1d85fc4d08a0db6fa7c3274c5b327d546f840d557da6aa59211d90c8835d6eb59ed7a84a923cb1147842ea6d6cb447ec3d6fe77f32ce54ea2e5a3
7
- data.tar.gz: ac42e747670f86c4435c169765f2aa028c9219fe938624b3a0b29775c2eb21520b7a5c2879a99eec7e221092161e3512c4dc8dc3afc586ad4ea6f3571f4b7bb0
6
+ metadata.gz: 99f3b3db0ecc9ed025011d85ba4f3b1118a3e35f9a19b5b0c2df88a73d7ff7ef3e71d68ee0ece63029e6e6cbe8f33ca96c789c516d5f57bcd8ab717dd371167e
7
+ data.tar.gz: f3adac92ac52c25f00f240e4d7836d4e9d615cd2f0c37bd2be18174a3fe582fa46f15425b4a81b80511998f72650f1097a4d2e5aff05ba7682bcc31b49e0abec
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  ## Unreleased
2
- [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta7...HEAD)
2
+ [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta8...HEAD)
3
3
 
4
4
 
5
+ ## v0.1.0.beta8
6
+ [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta7...v0.1.0.beta8)
7
+
8
+ * Generate oldest version release note [!16](https://gitlab.com/sue445/gitlab_awesome_release/merge_requests/16) *@sue445*
9
+ * Add footnote [!17](https://gitlab.com/sue445/gitlab_awesome_release/merge_requests/17) *@sue445*
10
+
5
11
  ## v0.1.0.beta7
6
12
  [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta6...v0.1.0.beta7)
7
13
 
@@ -37,3 +43,6 @@
37
43
 
38
44
  * Bugfix: uninitialized constant GitlabAwesomeRelease::ArrayWithinExt (NameError) [!5](https://gitlab.com/sue445/gitlab_awesome_release/merge_requests/5) *@sue445*
39
45
 
46
+ ## v0.1.0.beta1
47
+
48
+ *This Change Log was automatically generated by [gitlab_awesome_release](https://gitlab.com/sue445/gitlab_awesome_release)*
data/README.md CHANGED
@@ -5,6 +5,8 @@ Generate changelog from tags and MergeRequests on [GitLab](https://about.gitlab.
5
5
  [![build status](https://gitlab.com/ci/projects/9759/status.png?ref=master)](https://gitlab.com/ci/projects/9759?ref=master)
6
6
  [![Dependency Status](https://gemnasium.com/7f058801015a4fbcf603d936c08836a4.svg)](https://gemnasium.com/19478d2f2735ee355f4c6cd1b8d2c12e)
7
7
 
8
+ This is inspired by [GitHub Changelog Generator](https://github.com/skywinder/github-changelog-generator)
9
+
8
10
  ## Example
9
11
  see [CHANGELOG.md](CHANGELOG.md)
10
12
 
@@ -63,6 +65,32 @@ All options can be specified in both the command arguments and environment varia
63
65
  * Log level `(debug|info|warn|error|fatal|unknown)`
64
66
  * default: `info`
65
67
 
68
+ ### `create_latest_note`
69
+ generate release note only latest version and unreleased
70
+
71
+ ```sh
72
+ $ gitlab_awesome_release create_latest_note
73
+ ```
74
+
75
+ ### options
76
+ All options can be specified in both the command arguments and environment variables
77
+
78
+ * `--gitlab-api-endpoint` , `GITLAB_API_ENDPOINT` **(either one is required)**
79
+ * GitLab API endpoint (e.g. `http://example.com/api/v3`)
80
+ * `--gitlab-api-private-token` , `GITLAB_API_PRIVATE_TOKEN` **(either one is required)**
81
+ * Your private token. see [/profile/account](img/private_token.png)
82
+ * `--gitlab-project-name` , `GITLAB_PROJECT_NAME` **(either one is required)**
83
+ * Target project (e.g. `group/repo_name`)
84
+ * `--filename` , `FILENAME`
85
+ * Filepath to changelog file (e.g. `CHANGELOG.md`)
86
+ * if empty, output to console
87
+ * `--allow-tag-format` , `ALLOW_TAG_FORMAT`
88
+ * Tag format for release note heading (regular expresion pattern)
89
+ * default: `^v?[\d.]+`
90
+ * `--log-level` , `LOG_LEVEL`
91
+ * Log level `(debug|info|warn|error|fatal|unknown)`
92
+ * default: `info`
93
+
66
94
  ### marking
67
95
  Add version label to MergeRequests
68
96
 
@@ -41,6 +41,31 @@ module GitlabAwesomeRelease
41
41
  @logger.info "finish!"
42
42
  end
43
43
 
44
+ desc "create_latest_note", "generate release note only latest version and unreleased"
45
+ option :gitlab_api_endpoint, desc: GITLAB_API_DESCRIPTION
46
+ option :gitlab_api_private_token, desc: GITLAB_API_PRIVATE_TOKEN_DESCRIPTION
47
+ option :gitlab_project_name, desc: GITLAB_API_PROJECT_NAME
48
+ option :filename, desc: "Filepath to changelog file (e.g. CHANGELOG.md). if empty, output to console"
49
+ option :allow_tag_format, desc: "Tag format for release note heading (regular expresion pattern)", default: DEFAULT_VERSION_FORMAT
50
+ option :log_level, desc: LOG_LEVEL_DESCRIPTION, default: "info"
51
+ def create_latest_note
52
+ Dotenv.load(*GITLAB_ENV_FILES)
53
+
54
+ project = create_project
55
+
56
+ tag_names = project.release_tag_names
57
+
58
+ changelog =
59
+ if tag_names.count >= 2
60
+ project.generate_change_log(tag_names[-2], tag_names[-1])
61
+ elsif tag_names.count == 1
62
+ project.generate_change_log(tag_names[0], tag_names[0])
63
+ end
64
+
65
+ write_changelog(changelog) if changelog
66
+ @logger.info "finish!"
67
+ end
68
+
44
69
  desc "marking", "Add version label to MergeRequests"
45
70
  option :gitlab_api_endpoint, desc: GITLAB_API_DESCRIPTION
46
71
  option :gitlab_api_private_token, desc: GITLAB_API_PRIVATE_TOKEN_DESCRIPTION
@@ -48,11 +48,11 @@ module GitlabAwesomeRelease
48
48
  # @return [String]
49
49
  def generate_change_log(oldest_tag, newest_tag)
50
50
  release_notes = []
51
- release_notes << generate_heading(oldest_tag)
51
+ release_notes << generate_heading(oldest_tag) if oldest_tag == release_tag_names.first
52
52
  release_tag_names.within(oldest_tag, newest_tag).each_cons(2) do |from, to|
53
53
  release_notes << generate_release_note(from, to)
54
54
  end
55
- release_notes << generate_release_note(newest_tag, "HEAD", title: "Unreleased") if newest_tag == all_tag_names.last
55
+ release_notes << generate_release_note(newest_tag, "HEAD", title: "Unreleased") if newest_tag == release_tag_names.last
56
56
 
57
57
  changelog =
58
58
  release_notes.reverse.each_with_object("") do |release_note, str|
@@ -1,3 +1,3 @@
1
1
  module GitlabAwesomeRelease
2
- VERSION = "0.1.0.beta8"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_awesome_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -223,9 +223,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
223
  version: 2.1.0
224
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  requirements:
226
- - - ">"
226
+ - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: 1.3.1
228
+ version: '0'
229
229
  requirements: []
230
230
  rubyforge_project:
231
231
  rubygems_version: 2.4.5.1