create_github_release 1.3.0 → 1.3.2

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: 04e71e4f65e274c0bea5a1629d80b2f88689e547f07fa644b51cbaf480877122
4
- data.tar.gz: f105cc39f93ff1c3f3cb85f8d675fb18163a4f1054130c3f3fa1871d7c22c66f
3
+ metadata.gz: ad4b627e248269d5ca7f6b8118c8ec5a1c612b066b091655ef7d0826d395f494
4
+ data.tar.gz: bcbeb39161236026fb130678a8539d1bbdf6b363ab5acf40dcacb6b4dbfaa3eb
5
5
  SHA512:
6
- metadata.gz: 7c1b778ad46a00c912850f1cb09daacf6615f27cf1c8fbddaaa5f02a7c4e7cbc63a617868e431dca80aae6500b070c5d1b7fc2c50c7ccc1b0e363e2a332a122f
7
- data.tar.gz: 7f2bd65c4ac7cadf6ec45a7c4fbf914a8287b7c99bab509a2618161002978bdcd805d8236161a2e6c47827de9a79577ca62eae5f47986c4ac6491c91df0cb850
6
+ metadata.gz: d851c6e20196cdefd52601d088a4a5d8bb6e2ce687e19e4efb1beba5f10beeb2e0103df378bd4d9ade245a0c95540d8351ee6be8687e5c94f2943de6a2a64d7b
7
+ data.tar.gz: 6640d305d84d987b7645fcedb2c2a2b3e17d423d619c256584b442fcfdc44c8354170d96fb07646b32da8d2f496cb48ea9b9bf278591014dadd058f6bdf47975
data/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ 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.2 (2024-01-08)
9
+
10
+ [Full Changelog](https://github.com/main-branch/create_github_release/compare/v1.3.1..v1.3.2)
11
+
12
+ Changes since v1.3.1:
13
+
14
+ * 6b0e295 Delete the release in GitHub and add a comment to the release PR (#52)
15
+
16
+ ## v1.3.1 (2024-01-08)
17
+
18
+ [Full Changelog](https://github.com/main-branch/create_github_release/compare/v1.3.0..v1.3.1)
19
+
20
+ Changes since v1.3.0:
21
+
22
+ * 7015e17 Require create_github_release/version where the gem version is needed (#50)
23
+
8
24
  ## v1.3.0 (2024-01-08)
9
25
 
10
26
  [Full Changelog](https://github.com/main-branch/create_github_release/compare/v1.2.0..v1.3.0)
@@ -5,6 +5,7 @@
5
5
  # It will delete the release branch and tag locally and remotely
6
6
 
7
7
  require 'create_github_release'
8
+ require 'create_github_release/version'
8
9
 
9
10
  require 'English'
10
11
  require 'optparse'
@@ -18,6 +19,7 @@ class Options
18
19
  def release_tag = @release_tag ||= "v#{release_version}"
19
20
  def release_branch = @release_branch ||= "release-#{release_tag}"
20
21
  def current_branch = @current_branch ||= `git rev-parse --abbrev-ref HEAD`.chomp
22
+ def release_pr = @release_pr ||= `gh pr list --search "head:#{release_branch}" --json number --jq ".[].number"`.chomp
21
23
  def remote = @remote ||= 'origin'
22
24
  end
23
25
 
@@ -78,6 +80,8 @@ class Parser
78
80
  Usage:
79
81
  #{File.basename($PROGRAM_NAME)} [--help | --version]
80
82
 
83
+ Version #{CreateGithubRelease::VERSION}
84
+
81
85
  This script reverts the effect of running the create-github-release script.
82
86
  It must be run in the root directory of the work tree with the release
83
87
  branch checked out (which is the state create-github-release leaves you in).
@@ -138,6 +142,16 @@ def ref_exists?(name)
138
142
  $CHILD_STATUS.success?
139
143
  end
140
144
 
145
+ def revert_release!(options)
146
+ `gh pr comment #{options.release_pr} --body="Reverting this release using revert-github-release"`
147
+ `git checkout #{options.default_branch} >/dev/null`
148
+ `git branch -D #{options.release_branch} >/dev/null`
149
+ `git tag -d #{options.release_tag} >/dev/null`
150
+ `git push #{options.remote} --delete #{options.release_branch} >/dev/null`
151
+ `git push #{options.remote} --delete #{options.release_tag} >/dev/null`
152
+ `gh release delete #{options.release_tag} --yes >/dev/null`
153
+ end
154
+
141
155
  unless in_work_tree? && in_root_directory?
142
156
  warn 'ERROR: Not in the root directory of a Git work tree'
143
157
  exit 1
@@ -156,10 +170,6 @@ unless ref_exists?(options.default_branch)
156
170
  exit 1
157
171
  end
158
172
 
159
- `git checkout #{options.default_branch} >/dev/null`
160
- `git branch -D #{options.release_branch} >/dev/null`
161
- `git tag -d #{options.release_tag} >/dev/null`
162
- `git push #{options.remote} --delete #{options.release_branch} >/dev/null`
163
- `git push #{options.remote} --delete #{options.release_tag} >/dev/null`
173
+ revert_release!(options)
164
174
 
165
175
  puts "Reverted release #{options.release_version}"
@@ -3,6 +3,7 @@
3
3
  require 'English'
4
4
  require 'optparse'
5
5
  require 'create_github_release/command_line/options'
6
+ require 'create_github_release/version'
6
7
 
7
8
  module CreateGithubRelease
8
9
  module CommandLine
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CreateGithubRelease
4
4
  # The version of this gem
5
- VERSION = '1.3.0'
5
+ VERSION = '1.3.2'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_github_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James
@@ -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.0/file/CHANGELOG.md
254
- documentation_uri: https://rubydoc.info/gems/create_github_release/1.3.0
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
255
255
  rubygems_mfa_required: 'true'
256
256
  post_install_message:
257
257
  rdoc_options: []