ruby-gem-release 0.2.0 → 0.2.1

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: 46ed1a62b715dde573b31f304d33aae0df5eb2a574e42bfb69935a0600c6e43b
4
- data.tar.gz: 55f8f60509b26d6f7dac36d02e7d8300c1ab6d87701b6b2b28070cca0fb9a4fe
3
+ metadata.gz: e680c11bf15031ab4cf1e32f5a28f8f69219fbc0109cac2d52b7e544cc624f85
4
+ data.tar.gz: d20eb7fbb70c48c3ae559e8388c447b3d5319c3139bc3ec2041ecfafcf6f2922
5
5
  SHA512:
6
- metadata.gz: dcb52020ceab4b9902377d975765adcd67c2ec3de35fb2c4e1d8c6b6af7c37c0d0ec32e188793686b38af00405e110f1d7318988952583ff58675858957eb220
7
- data.tar.gz: cd7c6b2e4d8a503c4fb5ef333a9b8ed59ff97788b9a94669ef113ce0333af789d11edb59a84ab84a1b3927bea091b37421150c0959d124c33b5da019e4193c42
6
+ metadata.gz: 61cae2948e0dfd82ff24623eec92f3a6ac64e2082d221e7186a3c947a071e328367c2c08ab2308cf41c98d1ec23e62f4747815e4e07f76cc144e441220080a4c
7
+ data.tar.gz: ac28cdff7be72e83f9117331e3a4c4fcbcc1a221d9ed2321223e5ce5a46222060a7078bd2b995b98f185c04f2633ba853c7fd584deced8c1f940ed71943d40ad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 (2026/11/07)
4
+
5
+ - [#17](https://github.com/dblock/ruby-gem-release/pull/17): Avoid extra blank lines when releasing an empty changelog section and document release adoption and collaborator permissions - [@dblock](https://github.com/dblock).
6
+
3
7
  ## 0.2.0 (2026/11/07)
4
8
 
5
9
  - [#15](https://github.com/dblock/ruby-gem-release/pull/15): Add a Marketplace-ready composite action sharing Ruby release tasks, document action setup and publication, and pin workflow examples to `v0.2.0` - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  # Ruby Gem Release
4
4
 
5
- [![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)
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
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 version 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
+ - **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.
12
13
  - **Try it before publishing:** Dry runs exercise local commits, builds, and tags without uploading or pushing.
13
14
  - **Keep your conventions:** Use the standard workflow or compose Ruby objects and callbacks for custom releases.
14
15
 
@@ -87,6 +88,8 @@ gh workflow run release.yml -f rubygems-owner=YOUR_ACCOUNT_ID
87
88
  gh workflow run release.yml
88
89
  ```
89
90
 
91
+ For a real-world example of adding release automation to an existing gem, see [ruby-link-checker #26](https://github.com/dblock/ruby-link-checker/pull/26). It adds the dependency, Rake tasks, reusable workflow, and release instructions while preserving the existing changelog format.
92
+
90
93
  ## Configuration
91
94
 
92
95
  See [Detailed Usage](docs/usage.md#configuration) for workflow customization, callbacks, and available classes, and the [Actions Reference](docs/actions/release.md) for inputs and defaults.
@@ -24,7 +24,7 @@ module RubyGemRelease
24
24
  check_release_absent(content, version)
25
25
  section_end = section_end_position(content, position, prefix.length)
26
26
  content[position...section_end] = "#{prefix} #{version} (#{date.strftime('%Y/%m/%d')})" +
27
- remove_placeholder(content[line_end(content, position, separator)...section_end])
27
+ remove_placeholder(content[line_end(content, position, separator)...section_end], separator)
28
28
  File.write(@path, content)
29
29
  end
30
30
 
@@ -53,16 +53,22 @@ module RubyGemRelease
53
53
  heading_positions(content, /\A\#{1,6} /, max_level: level).find { |offset| offset > position } || content.length
54
54
  end
55
55
 
56
- def remove_placeholder(section)
56
+ def remove_placeholder(section, separator)
57
57
  positions = []
58
58
  editable_lines(section) { |line, offset| positions << offset if line.chomp == @placeholder }
59
59
  raise ArgumentError, "expected exactly one placeholder in #{@path}" unless positions.one?
60
60
 
61
61
  position = positions.first
62
- line_end = section.index("\n", position)
63
- section.slice!(position, (line_end ? line_end + 1 : section.length) - position)
62
+ section.slice!(position, placeholder_length(section, position, separator))
64
63
  section
65
64
  end
65
+
66
+ def placeholder_length(section, position, separator)
67
+ line_end = section.index("\n", position)
68
+ length = (line_end ? line_end + 1 : section.length) - position
69
+ length += separator.length if section[0...position].end_with?(separator * 2) && section[position + length, separator.length] == separator
70
+ length
71
+ end
66
72
  end
67
73
  end
68
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyGemRelease
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine