create_github_release 1.3.2 → 1.3.3

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
  SHA256:
3
- metadata.gz: ad4b627e248269d5ca7f6b8118c8ec5a1c612b066b091655ef7d0826d395f494
4
- data.tar.gz: bcbeb39161236026fb130678a8539d1bbdf6b363ab5acf40dcacb6b4dbfaa3eb
3
+ metadata.gz: aaae536c7d44e9ced42bb4598ebf91b3e803766c3a9b6283185fee4c7327c3db
4
+ data.tar.gz: bbbb70f42b368e513d419b2c16490b8ef48d4f6269df342f5d23db6e3088927c
5
5
  SHA512:
6
- metadata.gz: d851c6e20196cdefd52601d088a4a5d8bb6e2ce687e19e4efb1beba5f10beeb2e0103df378bd4d9ade245a0c95540d8351ee6be8687e5c94f2943de6a2a64d7b
7
- data.tar.gz: 6640d305d84d987b7645fcedb2c2a2b3e17d423d619c256584b442fcfdc44c8354170d96fb07646b32da8d2f496cb48ea9b9bf278591014dadd058f6bdf47975
6
+ metadata.gz: c3b4a8e4380a61ade20ea5833f7016bed6c5e056b37e78fb2cc6f589fcdce575d0cdd998c1d920507a3b2e6bca16837f99a02724e8d88e01ef9f00e1c9d066ff
7
+ data.tar.gz: df667078c1f6b9baccb7736a715343c8271dd3054ec42b96fa5bfb1115f955014a3f59f297e2d9cbdd15546dc787383e663c9eb0f756651e8ac812d5d4c35c32
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## v1.3.3 (2024-01-08)
9
+
10
+ [Full Changelog](https://github.com/main-branch/create_github_release/compare/v1.3.2..v1.3.3)
11
+
12
+ Changes since v1.3.2:
13
+
14
+ * 69c7a3f Show release PR URL and other minor changes in the output. (#54)
15
+
8
16
  ## v1.3.2 (2024-01-08)
9
17
 
10
18
  [Full Changelog](https://github.com/main-branch/create_github_release/compare/v1.3.1..v1.3.2)
@@ -13,18 +13,28 @@ puts unless options.quiet
13
13
  CreateGithubRelease::ReleaseTasks.new(project).run
14
14
 
15
15
  puts <<~MESSAGE unless project.quiet
16
- Release '#{project.next_release_tag}' created successfully
17
- See the release notes at #{project.release_url}
16
+ SUCCESS: created release '#{project.next_release_tag}'
18
17
 
19
18
  Next steps:
20
- * Get someone to review and approve the release pull request
21
- * Merge the pull request manually from the command line with the following commands:
19
+
20
+ * Review the release notes:
21
+
22
+ #{project.release_url}
23
+
24
+ * Get someone to review and approve the release pull request:
25
+
26
+ #{project.release_pr_url}
27
+
28
+ * Merge the pull request manually from the command line with the following
29
+ commands:
22
30
 
23
31
  git checkout #{project.default_branch}
24
32
  git merge --ff-only #{project.release_branch}
25
33
  git push
26
34
 
27
- Wait for the CI build to pass and then release the gem with the following command:
35
+ * Wait for the CI build to pass on the default branch and then release the
36
+ gem with the following command:
28
37
 
29
38
  rake release:rubygem_push
39
+
30
40
  MESSAGE
@@ -86,11 +86,13 @@ class Parser
86
86
  It must be run in the root directory of the work tree with the release
87
87
  branch checked out (which is the state create-github-release leaves you in).
88
88
 
89
- This script should be run beefore the release PR is merged.
89
+ This script should be run before the release PR is merged.
90
90
 
91
- This script removes the release branch and release tag both in the local
92
- repository and on the remote. Deleting the branch on GitHub will close the
93
- GitHub PR automatically.
91
+ This script does the following:
92
+ * Deletes the local and remote release branch
93
+ * Deletes the local and remote release tag
94
+ * Deletes the GitHub release object
95
+ * Closes the GitHub release PR
94
96
 
95
97
  Options:
96
98
  BANNER
@@ -172,4 +174,4 @@ end
172
174
 
173
175
  revert_release!(options)
174
176
 
175
- puts "Reverted release #{options.release_version}"
177
+ puts "SUCCESS: reverted release '#{options.release_version}'"
@@ -69,7 +69,7 @@ module CreateGithubRelease
69
69
  :release_type, :pre, :pre_type, :release_url, :remote, :remote_base_url,
70
70
  :remote_repository, :remote_url, :changelog_path, :changes,
71
71
  :next_release_description, :last_release_changelog, :next_release_changelog,
72
- :first_commit, :verbose, :quiet
72
+ :first_commit, :verbose, :quiet, :release_pr_number, :release_pr_url
73
73
 
74
74
  # attr_writer :first_release
75
75
 
@@ -324,6 +324,47 @@ module CreateGithubRelease
324
324
  end
325
325
  end
326
326
 
327
+ # @!attribute [rw] release_pr_number
328
+ #
329
+ # The number of the pull request created for the release or nil
330
+ #
331
+ # The PR must already exist.
332
+ #
333
+ # @example
334
+ # options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
335
+ # project = CreateGithubRelease::Project.new(options)
336
+ # project.release_pr_number #=> '123'
337
+ #
338
+ # @return [String, nil]
339
+ #
340
+ # @api public
341
+ #
342
+ def release_pr_number
343
+ @release_pr_number ||= begin
344
+ pr_number = `gh pr list --search "head:#{release_branch}" --json number --jq ".[].number"`.chomp
345
+ pr_number.empty? ? nil : pr_number
346
+ end
347
+ end
348
+
349
+ # @!attribute [rw] release_pr_url
350
+ #
351
+ # The url of the pull request created for the release or nil
352
+ #
353
+ # The PR must already exist.
354
+ #
355
+ # @example
356
+ # options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
357
+ # project = CreateGithubRelease::Project.new(options)
358
+ # project.release_pr_url #=> 'https://github.com/org/repo/pull/123'
359
+ #
360
+ # @return [String]
361
+ #
362
+ # @api public
363
+ #
364
+ def release_pr_url
365
+ @release_pr_url ||= release_pr_number.nil? ? nil : URI.parse("#{remote_url}/pull/#{release_pr_number}")
366
+ end
367
+
327
368
  # @!attribute [rw] release_type
328
369
  #
329
370
  # The type of the release being created (e.g. 'major', 'minor', 'patch')
@@ -713,12 +754,15 @@ module CreateGithubRelease
713
754
  CreateGithubRelease::Changelog.new(last_release_changelog, next_release_description).to_s
714
755
  end
715
756
 
757
+ # rubocop:disable Metrics/AbcSize
758
+
716
759
  # Show the project details as a string
717
760
  #
718
761
  # @example
719
762
  # options = CreateGithubRelease::CommandLine::Options.new(release_type: 'major')
720
763
  # project = CreateGithubRelease::Project.new(options)
721
764
  # puts projects.to_s
765
+ # first_release: false
722
766
  # default_branch: main
723
767
  # next_release_tag: v1.0.0
724
768
  # next_release_date: 2023-02-01
@@ -733,6 +777,8 @@ module CreateGithubRelease
733
777
  # remote_base_url: https://github.com/
734
778
  # remote_repository: org/repo
735
779
  # remote_url: https://github.com/org/repo
780
+ # release_pr_number: 123
781
+ # release_pr_url: https://github.com/org/repo/pull/123
736
782
  # changelog_path: CHANGELOG.md
737
783
  # verbose?: false
738
784
  # quiet?: false
@@ -758,11 +804,16 @@ module CreateGithubRelease
758
804
  remote_base_url: #{remote_base_url}
759
805
  remote_repository: #{remote_repository}
760
806
  remote_url: #{remote_url}
807
+ release_pr_number: #{release_pr_number}
808
+ release_pr_url: #{release_pr_url}
809
+ changelog_path: #{changelog_path}
761
810
  verbose?: #{verbose?}
762
811
  quiet?: #{quiet?}
763
812
  OUTPUT
764
813
  end
765
814
 
815
+ # rubocop:enable Metrics/AbcSize
816
+
766
817
  # @!attribute [rw] verbose
767
818
  #
768
819
  # If `true` enables verbose output
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CreateGithubRelease
4
4
  # The version of this gem
5
- VERSION = '1.3.2'
5
+ VERSION = '1.3.3'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_github_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semverify
@@ -250,8 +250,8 @@ metadata:
250
250
  allowed_push_host: https://rubygems.org
251
251
  homepage_uri: https://github.com/main-branch/create_github_release
252
252
  source_code_uri: https://github.com/main-branch/create_github_release
253
- changelog_uri: https://rubydoc.info/gems/create_github_release/1.3.2/file/CHANGELOG.md
254
- documentation_uri: https://rubydoc.info/gems/create_github_release/1.3.2
253
+ changelog_uri: https://rubydoc.info/gems/create_github_release/1.3.3/file/CHANGELOG.md
254
+ documentation_uri: https://rubydoc.info/gems/create_github_release/1.3.3
255
255
  rubygems_mfa_required: 'true'
256
256
  post_install_message:
257
257
  rdoc_options: []