ruby-gem-release 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 469e595224af37d45f614a03b2a921a4dbf95cd48cce2e06a22a77afaaae1309
4
- data.tar.gz: 4ca11264c3d08b8ab09c877e7405466d96c368db09937beb70bbd004fea83118
3
+ metadata.gz: 3159b6a34e7a7ee3eb36a7441bccda73603c8a52cfc1ff3947d1f1537541384f
4
+ data.tar.gz: cc91123bbeb89c0c204ec9cb9d497612b96e46157e55eff91910c671fb7f751a
5
5
  SHA512:
6
- metadata.gz: 820916d325fa76a47d54aca30813ff79af9e565a8463df8fddc73ec69cd629ff256fa72dd36dad2cf01f1317bf015ee519342e823abcdb767a5338fd53eea773
7
- data.tar.gz: 2b0185aa185436463e69b398371b8932bd8f1ed59964f1278f16274026c7c8d13fc1f7df51e2a8a1e2051782a43ad762a4355a4f45239159727b904df5e66372
6
+ metadata.gz: d87ee0f1c275ba6bdeffffa4bf5d9ec1026cda40f397f21bf17e08596c61ab3f78d4d6e195a72240a00b284f886e139d80f7f0d37302c1dd5f502b750ab4cdc7
7
+ data.tar.gz: 0a90bfb6f3279c0264b93ba0d6618f5030ea3e396840122e20bd7a9196e68427d410e14a2adc014983d716f44201cfeca3581aa9c316bc52c293edf276eb12e7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3 (2026/11/08)
4
+
5
+ - [#21](https://github.com/dblock/ruby-gem-release/pull/21): Remove dry-run inputs and release context, always publish when dispatched, and test installed release callbacks with isolated publication boundaries (breaking change) - [@dblock](https://github.com/dblock).
6
+
3
7
  ## 0.2.2 (2026/11/08)
4
8
 
5
9
  - [#18](https://github.com/dblock/ruby-gem-release/pull/18): Update README release tags as part of the next development iteration - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -4,13 +4,12 @@
4
4
 
5
5
  [![Gem Version](https://img.shields.io/gem/v/ruby-gem-release.svg)](https://rubygems.org/gems/ruby-gem-release) [![Test](https://github.com/dblock/ruby-gem-release/actions/workflows/test.yml/badge.svg)](https://github.com/dblock/ruby-gem-release/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/dblock/ruby-gem-release/badge.svg?branch=master)](https://coveralls.io/github/dblock/ruby-gem-release?branch=master)
6
6
 
7
- **Release your Ruby gem from GitHub Actions—without maintaining custom release scripts or storing a RubyGems API key.**
7
+ **Release your Ruby gem from GitHub Actions without maintaining custom release scripts or storing a RubyGems API key.**
8
8
 
9
9
  Update your changelog, validate and publish your gem, create its GitHub Release, and prepare the next development iteration with one workflow dispatch. Choose your version and changelog formats; the standard workflow handles the release sequence.
10
10
 
11
11
  - **No stored RubyGems API key:** Authenticate with RubyGems Trusted Publishing using OpenID Connect (OIDC).
12
12
  - **Let collaborators release:** After one-time setup, collaborators with write access, including on personal repositories, can dispatch releases without repository admin access or their own RubyGems credentials.
13
- - **Try it before publishing:** Dry runs exercise local commits, builds, and tags without uploading or pushing.
14
13
  - **Keep your conventions:** Use the standard workflow or compose Ruby objects and callbacks for custom releases.
15
14
 
16
15
  Requires Ruby 3.3+, GitHub Actions, and RubyGems Trusted Publishing.
@@ -19,7 +18,7 @@ Requires Ruby 3.3+, GitHub Actions, and RubyGems Trusted Publishing.
19
18
 
20
19
  ### 1. Configure Your Gem
21
20
 
22
- Add `ruby-gem-release` (`~> 0.2.0`) to the development dependencies and install the standard workflow in your Rakefile. Choose your version file and changelog format explicitly:
21
+ Add `ruby-gem-release` to the development dependencies and install the standard workflow in your Rakefile. Choose your version file and changelog format explicitly:
23
22
 
24
23
  ```ruby
25
24
  require 'ruby-gem-release/workflow/ruby_gem'
@@ -54,7 +53,7 @@ permissions:
54
53
 
55
54
  jobs:
56
55
  release:
57
- uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.2.1
56
+ uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.2.2
58
57
  with:
59
58
  ruby-version: '3.3'
60
59
  rubygems-owner: ${{ inputs.rubygems-owner }}
@@ -74,7 +73,7 @@ For example, the trusted publishers page for a gem named `example` is `https://r
74
73
 
75
74
  ### 4. Make a Release
76
75
 
77
- Your branch rules must permit release commits and tags to be pushed; see [branch permissions](RELEASING.md#one-time-setup). Review the changes and dispatch the workflow from your default branch:
76
+ Your branch rules must permit release commits and tags to be pushed; see [branch permissions](RELEASING.md#one-time-setup). Dispatching the workflow publishes the gem. Run your project's tests and build checks, review the changes, and dispatch from your default branch:
78
77
 
79
78
  **First release:** Pass the numeric RubyGems account ID shown on the Pending Trusted Publishers page as `rubygems-owner`. This declares the account that will own the gem on its first publication. Replace `YOUR_ACCOUNT_ID` below with that ID:
80
79
 
@@ -18,8 +18,6 @@ module RubyGemRelease
18
18
 
19
19
  tag = "v#{version}"
20
20
  paths = artifact_paths(package ? [package.artifact(release)] : artifacts)
21
- return if release.dry_run?
22
-
23
21
  output, error, status = Open3.capture3(*command(tag), *paths)
24
22
  raise "GitHub Release creation failed: #{error.strip}" unless status.success?
25
23
 
@@ -41,8 +41,6 @@ module RubyGemRelease
41
41
 
42
42
  def publish!(release)
43
43
  path = artifact(release)
44
- return path if release.dry_run?
45
-
46
44
  run(Gem.ruby, '-S', 'gem', 'push', path)
47
45
  end
48
46
 
@@ -6,9 +6,7 @@ module RubyGemRelease
6
6
  class Release
7
7
  attr_reader :version, :previous_version, :next_version, :date
8
8
 
9
- def initialize(date:, version:, previous_version:, next_version: nil, dry_run: false)
10
- raise ArgumentError, 'dry_run must be true or false' unless [true, false].include?(dry_run)
11
-
9
+ def initialize(date:, version:, previous_version:, next_version: nil)
12
10
  validate_versions(version, previous_version, next_version)
13
11
  raise ArgumentError, 'date must be a Date' unless date.instance_of?(Date)
14
12
 
@@ -16,20 +14,15 @@ module RubyGemRelease
16
14
  @previous_version = previous_version.dup.freeze
17
15
  @next_version = next_version&.dup&.freeze
18
16
  @date = date.dup.freeze
19
- @dry_run = dry_run
20
17
  freeze
21
18
  end
22
19
 
23
20
  def with_version(version)
24
- self.class.new(version: version, previous_version: @previous_version, date: @date, next_version: @next_version, dry_run: @dry_run)
21
+ self.class.new(version: version, previous_version: @previous_version, date: @date, next_version: @next_version)
25
22
  end
26
23
 
27
24
  def with_next_version(version)
28
- self.class.new(version: @version, previous_version: @previous_version, date: @date, next_version: version, dry_run: @dry_run)
29
- end
30
-
31
- def dry_run?
32
- @dry_run
25
+ self.class.new(version: @version, previous_version: @previous_version, date: @date, next_version: version)
33
26
  end
34
27
 
35
28
  private
@@ -31,10 +31,8 @@ module RubyGemRelease
31
31
  raise "Cannot check release tag: #{output}" unless status.exitstatus == 1
32
32
  end
33
33
 
34
- def check_current!(release, expected: head)
34
+ def check_current!(_release, expected: head)
35
35
  run('fetch', @remote, branch, '--tags')
36
- return if release.dry_run?
37
-
38
36
  raise 'Default branch advanced; start a new release' unless remote_head == expected
39
37
  end
40
38
 
@@ -64,7 +62,6 @@ module RubyGemRelease
64
62
 
65
63
  def push!(release = @release)
66
64
  raise ArgumentError, 'a release context is required before pushing' unless release
67
- return if release.dry_run?
68
65
 
69
66
  if @next_commit_parent
70
67
  check_current!(release, expected: @next_commit_parent)
@@ -83,7 +83,7 @@ module RubyGemRelease
83
83
  validate_context_versions(version, previous_version)
84
84
  raise ArgumentError, 'release date is required in YYYY-MM-DD format' unless date.match?(/\A\d{4}-\d{2}-\d{2}\z/)
85
85
 
86
- Release.new(version: version, previous_version: previous_version, date: Date.iso8601(date), dry_run: ENV.fetch('DRY_RUN', 'false') == 'true')
86
+ Release.new(version: version, previous_version: previous_version, date: Date.iso8601(date))
87
87
  end
88
88
 
89
89
  def validate_context_versions(*versions)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyGemRelease
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
@@ -9,17 +9,14 @@ module RubyGemRelease
9
9
  module Workflow
10
10
  class Context
11
11
  def configure!
12
- raise ArgumentError, 'dry-run must be true or false' unless %w[true false].include?(ENV.fetch('DRY_RUN'))
13
-
14
- names = %w[INPUT_VERSION INPUT_GEMSPEC DEFAULT_BRANCH DRY_RUN GIT_USER_NAME GIT_USER_EMAIL RUBYGEMS_OWNER]
12
+ names = %w[INPUT_VERSION INPUT_GEMSPEC DEFAULT_BRANCH GIT_USER_NAME GIT_USER_EMAIL RUBYGEMS_OWNER]
15
13
  export(names.to_h { |name| [name, ENV.fetch(name)] })
16
14
  end
17
15
 
18
16
  def capture!
19
- dry_run = ENV.fetch('DRY_RUN', 'false') == 'true'
20
- check_branch(dry_run)
17
+ check_branch
21
18
  package = Package::RubyGem.new(gemspec: ENV.fetch('INPUT_GEMSPEC', nil))
22
- release = initial_release(package, dry_run: dry_run)
19
+ release = initial_release(package)
23
20
  git = configured_git
24
21
  git.check_current!(release)
25
22
  export('GEMSPEC' => package.gemspec, 'RELEASE_PREVIOUS_VERSION' => release.version,
@@ -38,11 +35,11 @@ module RubyGemRelease
38
35
 
39
36
  private
40
37
 
41
- def initial_release(package, dry_run:)
38
+ def initial_release(package)
42
39
  version = package.version
43
40
  validate_version(version)
44
41
  validate_version(ENV.fetch('INPUT_VERSION')) unless ENV.fetch('INPUT_VERSION', '').empty?
45
- Release.new(version: version, previous_version: version, date: Time.now.utc.to_date, dry_run: dry_run)
42
+ Release.new(version: version, previous_version: version, date: Time.now.utc.to_date)
46
43
  end
47
44
 
48
45
  def configured_git
@@ -52,8 +49,7 @@ module RubyGemRelease
52
49
  end
53
50
  end
54
51
 
55
- def check_branch(dry_run)
56
- return if dry_run
52
+ def check_branch
57
53
  return if ENV.fetch('GITHUB_REF') == "refs/heads/#{ENV.fetch('DEFAULT_BRANCH')}"
58
54
 
59
55
  raise 'Releases must run from the default branch'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-gem-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine