bake-modernize 0.65.0 → 0.66.0

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: 32e279a2cd64b6db3d274c56caed5dd93cc3f8a5854c6cad52252354ab110968
4
- data.tar.gz: e8314e50b8118a0d0a6f897088b791c4b1d743a648cb7d92e9ab3338e0c7c17e
3
+ metadata.gz: 86088eb1ce54261f44c72af7f45c7b52e407aeb0e1d4d09a91e27bb0ddbcff1c
4
+ data.tar.gz: f415b2e231df146da6fd9679e64a0a97321f02cae27e30460bbd47be204e6a1e
5
5
  SHA512:
6
- metadata.gz: 4c90c6778c2878f35d4ec00c79e7a17c48af5a0da3ff949db6ee8705169f3ab6c2d087633497d4ee1889e3dac1d135d53ae0bd25aace031374a23a19a6fcbaad
7
- data.tar.gz: f4d0775f78dea54d1cd5ac739ecf17fe12169d39f9123fac195b1159b9e7e0c1291622782a76e4b703978445dc17a994d805d4149bb6664496812b2bb960c4c0
6
+ metadata.gz: e25e523c96e28bc7296b7038bb4a9850ba6804f197ed3388a67c85a948a6ae0b1d5632deb2ae30ad665ee3fc5c8528accae97678b3847e386494d49818d31c49
7
+ data.tar.gz: 36f5a150a52eb7fb8f74e3044f14d6f08850ee17af0e9ff9d017653ac7df3ac0c9ff9ec48f46ac4c159c1b7d8bac89d9bd22590dec6f871514177f6419b1d981
@@ -24,7 +24,6 @@ def update(path: default_gemspec_path, output: $stdout)
24
24
  spec = ::Gem::Specification.load(path)
25
25
 
26
26
  root = File.dirname(path)
27
- signing = Bake::Modernize::Signing.new(spec)
28
27
  version_path = version_path(root, spec.name)
29
28
 
30
29
  constant = File.read(File.join(root, version_path))
@@ -52,14 +51,6 @@ def update(path: default_gemspec_path, output: $stdout)
52
51
  output.puts "\tspec.authors = #{spec.authors.inspect}"
53
52
  output.puts "\tspec.license = #{spec.license.inspect}"
54
53
 
55
- certificate_path = File.expand_path("release.cert", root)
56
-
57
- if File.exist?(certificate_path)
58
- output.puts "\t"
59
- output.puts "\tspec.cert_chain = [\"release.cert\"]"
60
- output.puts "\tspec.signing_key = #{signing.private_key_expression}"
61
- end
62
-
63
54
  if spec.homepage and !spec.homepage.empty?
64
55
  output.puts "\t"
65
56
  output.puts "\tspec.homepage = #{spec.homepage.inspect}"
@@ -201,6 +192,7 @@ end
201
192
  GITHUB_PROJECT = /github.com\/(?<account>.*?)\/(?<project>.*?)(\/|\Z)/
202
193
 
203
194
  def update_metadata(spec)
195
+ spec.metadata.delete("signing_owner")
204
196
  spec.metadata["bug_tracker_uri"] ||= detect_bug_tracker_uri(spec)
205
197
  spec.metadata["changelog_uri"] ||= detect_changelog_uri(spec)
206
198
  spec.metadata["documentation_uri"] ||= detect_documentation_uri(spec)
data/bake/modernize.rb CHANGED
@@ -12,7 +12,6 @@ def modernize
12
12
  "modernize:gemfile",
13
13
  "modernize:actions",
14
14
  "modernize:rubocop",
15
- "modernize:signing",
16
15
  "modernize:gemspec",
17
16
  "modernize:license",
18
17
  "modernize:contributing",
@@ -25,7 +25,7 @@ If `bake-modernize` is already installed, use `bundle update bake-modernize --co
25
25
 
26
26
  ## Update a gem
27
27
 
28
- Start from an up-to-date checkout with a clean working tree and create a branch for the modernization. Check the gem's supported Ruby versions, CI jobs, release process, signing configuration, and custom Bake tasks before updating them.
28
+ Start from an up-to-date checkout with a clean working tree and create a branch for the modernization. Check the gem's supported Ruby versions, CI jobs, release process, and custom Bake tasks before updating them.
29
29
 
30
30
  List the available tasks, then run the default modernization from the gem's root directory:
31
31
 
@@ -45,7 +45,9 @@ bundle exec bake modernize:license
45
45
  bundle exec bake modernize:releases
46
46
  ```
47
47
 
48
- Check the resulting Ruby compatibility requirements, gem dependencies, workflow names and required status checks, gemspec file list, signing paths, and release hooks. Preserve custom tasks and project-specific CI. Copyright generation ignores author names ending in `[bot]`; `.mailmap`, `.contributors.yaml`, and human authorship through file renames remain supported.
48
+ Check the resulting Ruby compatibility requirements, gem dependencies, workflow names and required status checks, gemspec file list, and release hooks. Preserve custom tasks and project-specific CI. Copyright generation ignores author names ending in `[bot]`; `.mailmap`, `.contributors.yaml`, and human authorship through file renames remain supported.
49
+
50
+ Modernization removes legacy `cert_chain`, `signing_key`, and `signing_owner` settings from gemspecs. It does not copy RubyGems signing certificates or configure private keys. Release provenance is provided by Trusted Publishing and the attestations generated by `bake-gem-github`.
49
51
 
50
52
  Run the project's checks before opening a PR. For gems using the standard Sus, RuboCop, and Decode tasks:
51
53
 
@@ -80,7 +82,7 @@ bundle exec bake gem:github:setup:plan
80
82
 
81
83
  For an existing `config/release.yaml`, use `bundle exec bake gem:github:setup:update` to regenerate managed files instead. Review and commit the generated workflows, rulesets, configuration, and readme changes. Keep the readme's `Making Releases` section short: a release command and a link to [bake-gem-github](https://github.com/socketry/bake-gem-github).
82
84
 
83
- Complete the setup described by [bake-gem-github](https://github.com/socketry/bake-gem-github): configure the RubyGems Trusted Publisher for `release-publish.yaml` and the `rubygems` environment, restrict that environment to the default branch, and install a matching signing key if signing is enabled. Select environment reviewers per repository when a separate publishing approval is wanted, for example `reviewers: [socketry/managers]`. Omitting reviewers leaves the environment's existing reviewer configuration unchanged.
85
+ Complete the setup described by [bake-gem-github](https://github.com/socketry/bake-gem-github): configure the RubyGems Trusted Publisher for `release-publish.yaml` and the `rubygems` environment, and restrict that environment to the default branch. Select environment reviewers per repository when a separate publishing approval is wanted, for example `reviewers: [socketry/managers]`. Omitting reviewers leaves the environment's existing reviewer configuration unchanged.
84
86
 
85
87
  After the setup PR is merged and the required CI jobs are available, an administrator reviews the plan and runs `bundle exec bake gem:github:setup:apply`. Generating files or upgrading gems does not apply remote settings. Workflow execution approvals, PR reviews, and publishing environment approvals are separate controls.
86
88
 
data/context/index.yaml CHANGED
@@ -7,7 +7,6 @@ metadata:
7
7
  changelog_uri: https://github.com/ioquatix/bake-modernize/blob/main/releases.md
8
8
  documentation_uri: https://ioquatix.github.io/bake-modernize/
9
9
  funding_uri: https://github.com/sponsors/ioquatix/
10
- signing_owner: socketry
11
10
  source_code_uri: https://github.com/ioquatix/bake-modernize.git
12
11
  files:
13
12
  - path: getting-started.md
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Bake
7
7
  module Modernize
8
- VERSION = "0.65.0"
8
+ VERSION = "0.66.0"
9
9
  end
10
10
  end
@@ -5,7 +5,6 @@
5
5
 
6
6
  require_relative "modernize/git"
7
7
  require_relative "modernize/license"
8
- require_relative "modernize/signing"
9
8
  require_relative "modernize/version"
10
9
 
11
10
  require "build/files/glob"
data/readme.md CHANGED
@@ -14,6 +14,10 @@ Please see the [project documentation](https://ioquatix.github.io/bake-modernize
14
14
 
15
15
  Please see the [project releases](https://ioquatix.github.io/bake-modernize/releases/index) for all releases.
16
16
 
17
+ ### v0.66.0
18
+
19
+ - Remove certificate signing tasks and gemspec settings. GitHub releases use Trusted Publishing and attestations without a separate RubyGems signing key.
20
+
17
21
  ### v0.64.0
18
22
 
19
23
  - Prefer the configured signing owner or GitHub owner when selecting RubyGems signing certificates and private keys.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.66.0
4
+
5
+ - Remove certificate signing tasks and gemspec settings. GitHub releases use Trusted Publishing and attestations without a separate RubyGems signing key.
6
+
3
7
  ## v0.64.0
4
8
 
5
9
  - Prefer the configured signing owner or GitHub owner when selecting RubyGems signing certificates and private keys.
metadata CHANGED
@@ -1,39 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-modernize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.65.0
4
+ version: 0.66.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Olle Jonsson
9
9
  - Copilot
10
10
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIEFDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADAwMREwDwYDVQQKDA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WG8DIVQ8cmR+TG6zjOmK
31
- iUiUZGNPnStV1O1xW83c+Ba4Am0krP6/forxDPhRvTehqkVYvMdPfYcICNb5IM58
32
- 5vaYvuj5AtfZuZWN0F/0KtSphhNC17rh6h8QmuYdMJ1clvlrkiEaO1UjPVwjgtxC
33
- x/ARh5X6q0/YTXl4r7EfSJEeqW7qhgu9EUj3mGIPHYdX0Dqih/NgK20F3GvQtTfB
34
- 7sse0duKBHXONYVwKAsceUVvqtCfyF608bCilCkbhw3QaInRj+BkRQKJ5Tuj2PZR
35
- 76a/hwaV2wWn5RtAFBaUQzQdo/xTqJ7IkwaFjOZe/QyvyoRjCK9Rdg==
36
- -----END CERTIFICATE-----
11
+ cert_chain: []
37
12
  date: 1980-01-02 00:00:00.000000000 Z
38
13
  dependencies:
39
14
  - !ruby/object:Gem::Dependency
@@ -152,17 +127,14 @@ files:
152
127
  - bake/modernize/readme.rb
153
128
  - bake/modernize/releases.rb
154
129
  - bake/modernize/rubocop.rb
155
- - bake/modernize/signing.rb
156
130
  - context/getting-started.md
157
131
  - context/index.yaml
158
132
  - lib/bake/modernize.rb
159
133
  - lib/bake/modernize/git.rb
160
134
  - lib/bake/modernize/license.rb
161
- - lib/bake/modernize/signing.rb
162
135
  - lib/bake/modernize/version.rb
163
136
  - license.md
164
137
  - readme.md
165
- - release.cert
166
138
  - releases.md
167
139
  - template/actions/.github/workflows/documentation-coverage.yaml
168
140
  - template/actions/.github/workflows/documentation.yaml
@@ -187,7 +159,6 @@ metadata:
187
159
  changelog_uri: https://github.com/ioquatix/bake-modernize/blob/main/releases.md
188
160
  documentation_uri: https://ioquatix.github.io/bake-modernize/
189
161
  funding_uri: https://github.com/sponsors/ioquatix/
190
- signing_owner: socketry
191
162
  source_code_uri: https://github.com/ioquatix/bake-modernize.git
192
163
  rdoc_options: []
193
164
  require_paths:
checksums.yaml.gz.sig DELETED
Binary file
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2021-2026, by Samuel Williams.
5
-
6
- require "bake/modernize"
7
-
8
- def signing(root: Dir.pwd)
9
- update(root: root)
10
- end
11
-
12
- def update(root:)
13
- signing = Bake::Modernize::Signing.load(root)
14
- certificate_path = File.expand_path("release.cert", root)
15
-
16
- if signing.certificate_path
17
- FileUtils.cp(signing.certificate_path, certificate_path)
18
- end
19
- end
@@ -1,85 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2026, by Samuel Williams.
5
-
6
- module Bake
7
- module Modernize
8
- # Resolve the RubyGems signing certificate and private key for a project.
9
- class Signing
10
- GEM_CREDENTIALS_PATH = File.expand_path("~/.gem")
11
- GITHUB_OWNER = %r{\Ahttps?://github\.com/([\w.-]+)/}
12
-
13
- # Load signing configuration from a project's gemspec.
14
- # @parameter root [String] The project root.
15
- # @returns [Signing] The signing configuration.
16
- def self.load(root)
17
- gemspec_path = Dir["*.gemspec", base: root].first
18
- gemspec = Gem::Specification.load(File.join(root, gemspec_path)) if gemspec_path
19
-
20
- return new(gemspec)
21
- end
22
-
23
- # @parameter gemspec [Gem::Specification | Nil] The project gemspec.
24
- def initialize(gemspec)
25
- @gemspec = gemspec
26
- end
27
-
28
- # The preferred certificate, if available.
29
- # @returns [String | Nil] The certificate path.
30
- def certificate_path
31
- paths = []
32
-
33
- if owner = signing_owner
34
- paths << File.join(GEM_CREDENTIALS_PATH, "#{owner}-release.cert")
35
- end
36
-
37
- paths << File.join(GEM_CREDENTIALS_PATH, "release.cert")
38
- return paths.find{|path| File.file?(path)}
39
- end
40
-
41
- # The private key path, preserving an existing gemspec setting.
42
- # @returns [String] The private key path.
43
- def private_key_path
44
- return @gemspec.signing_key if @gemspec&.signing_key
45
-
46
- if certificate_path = self.certificate_path
47
- return certificate_path.sub(/\.cert\z/, ".pem")
48
- end
49
-
50
- return File.join(GEM_CREDENTIALS_PATH, "release.pem")
51
- end
52
-
53
- # Format a private key path for use in a gemspec.
54
- # @returns [String] A Ruby expression.
55
- def private_key_expression
56
- prefix = GEM_CREDENTIALS_PATH + File::SEPARATOR
57
- path = self.private_key_path
58
-
59
- if path.start_with?(prefix)
60
- relative_path = path.delete_prefix(prefix)
61
- path = "~/.gem/#{relative_path}"
62
- return "File.expand_path(#{path.inspect})"
63
- end
64
-
65
- return path.inspect
66
- end
67
-
68
- private
69
-
70
- def signing_owner
71
- return unless @gemspec
72
-
73
- owner = @gemspec.metadata["signing_owner"]
74
- return owner if owner&.match?(/\A[\w.-]+\z/)
75
-
76
- urls = [@gemspec.metadata["source_code_uri"], @gemspec.homepage].compact
77
- urls.each do |url|
78
- if match = GITHUB_OWNER.match(url)
79
- return match[1]
80
- end
81
- end
82
- end
83
- end
84
- end
85
- end
data/release.cert DELETED
@@ -1,24 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIEFDCCAnygAwIBAgIBATANBgkqhkiG9w0BAQsFADAwMREwDwYDVQQKDAhTb2Nr
3
- ZXRyeTEbMBkGA1UEAwwSU29ja2V0cnkgUnVieSBHZW1zMB4XDTI2MDkyMTA3NTgx
4
- NFoXDTI3MDkyMTA3NTgxNFowMDERMA8GA1UECgwIU29ja2V0cnkxGzAZBgNVBAMM
5
- ElNvY2tldHJ5IFJ1YnkgR2VtczCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
6
- ggGBAM/QgjVgDzDo/xJEQoFvAzcVFP7msnswkhPJB2UDsbxXCZmers5jV512TM5s
7
- NwLHfzJiC4DcI5ax9ZYKM9Q+dS21YYagNqjtg3YPyDqR6phoibEA0VoMuInUQW68
8
- i5OkCJzYKGD2pYYVZnuFNqyM2ECUvXh/fBmvPoHbncAHhWPaCBH8mQJ8sRNc6+RV
9
- SoZZu1Yo/aW1zQ+SpZwad7s1ZmigfDNHKhJ22KwZHk+/5Zw1QXVfcajjswV0Mm2P
10
- irgjKN3fyNVkwlly63EBlR4VydT+g9QtJtqh7ee0ThhI+v4wYovf4dbLNcEBTHu1
11
- x1pGbXGx/2fBAST5eVwaXIx1V8VU22AJcBk1H2o5/1F0HfbD2HQjmFOA112KUwBW
12
- 9TtspZD3g6rCQFX53XvL9h6j2y1ukl7s5AdEzOe/x6r1MO8tSDtgcYoF89wgF/88
13
- Q/Eski0FckQ+znfESZcFcpzs2sPDoYW6SNVX4tZcNty85Y6WBHfHKio14x63PeyC
14
- CG1gMwIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
15
- SuMc0x24Xshtaa8SQVkBr2Z5WzIwDQYJKoZIhvcNAQELBQADggGBABI62ey5lDWm
16
- j8jsTQaNBMBb7LbKS3XkBwyL1UNGEwlicp399rJDeuNgVSHqBCZ/nE4yleNjgW9Y
17
- N6DKdxXCvXmFUoHvUINeAvThHxmlEGhSfXl1x55xHEig0rEP4jgdjnYdQI4fqeOM
18
- zIDN0F3ruArke4Y62SQgWVN7vspdAA41hBIRl1vsvs0KWG8DIVQ8cmR+TG6zjOmK
19
- iUiUZGNPnStV1O1xW83c+Ba4Am0krP6/forxDPhRvTehqkVYvMdPfYcICNb5IM58
20
- 5vaYvuj5AtfZuZWN0F/0KtSphhNC17rh6h8QmuYdMJ1clvlrkiEaO1UjPVwjgtxC
21
- x/ARh5X6q0/YTXl4r7EfSJEeqW7qhgu9EUj3mGIPHYdX0Dqih/NgK20F3GvQtTfB
22
- 7sse0duKBHXONYVwKAsceUVvqtCfyF608bCilCkbhw3QaInRj+BkRQKJ5Tuj2PZR
23
- 76a/hwaV2wWn5RtAFBaUQzQdo/xTqJ7IkwaFjOZe/QyvyoRjCK9Rdg==
24
- -----END CERTIFICATE-----
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file