Repository navigation
Release with ruby-gem-release - #84
Conversation
| %w[release release:rubygem_push release:source_control_push].each do |name| | ||
| Rake::Task[name].clear | ||
| desc 'Disabled; releases run through GitHub Actions, see RELEASING.md' | ||
| task(name) { abort "#{name} is disabled; releases run through GitHub Actions, see RELEASING.md" } |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [101/80]
|
|
||
| require 'bundler/gem_tasks' | ||
|
|
||
| if RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3') && |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [88/80]
| RubyGemRelease::Workflow::RubyGem.new( | ||
| version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/mongoid/geospatial/version.rb', | ||
| constant: 'VERSION'), | ||
| changelog: RubyGemRelease::Changelog::Intridea.new(placeholder: '* Your contribution here.'), |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [99/80]
| module MongoidGeospatialRelease | ||
| def self.workflow(**options) | ||
| RubyGemRelease::Workflow::RubyGem.new( | ||
| version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/mongoid/geospatial/version.rb', |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [99/80]
| require 'ruby-gem-release/changelog' | ||
| require 'ruby-gem-release/workflow/ruby_gem' | ||
|
|
||
| # Builds the ruby-gem-release workflow used by the Rakefile, the Release GitHub Actions workflow, and spec/release. |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [115/80]
| with_release_project do |project| | ||
| project.environment.merge!(ENV.to_h.slice('MONGOID_VERSION')) | ||
| project.copy_files(path: root, files: fixture_files) | ||
| project.configure_workflow(require: 'script/release', builder: 'MongoidGeospatialRelease.workflow') |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [107/80]
|
|
||
| def write_version(project, version) | ||
| source = File.read(File.join(root, version_path)) | ||
| project.write(version_path, source.sub(/VERSION = (['"])[^'"]+\1/, "VERSION = '#{version}'")) |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [99/80]
| ] | ||
| end | ||
| let(:placeholder) { '* Your contribution here.' } | ||
| let(:note) { '* [#1](https://github.com/mongoid/mongoid-geospatial/pull/1): Added a feature.' } |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [99/80]
| require_relative '../../script/release' | ||
| require 'ruby-gem-release/rspec' | ||
|
|
||
| RSpec.describe MongoidGeospatialRelease do |
There was a problem hiding this comment.
Metrics/BlockLength: Block has too many lines. [58/25]
| @@ -0,0 +1,77 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| if RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3') && | |||
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [88/80]
Add a manually dispatched Release workflow that uses the ruby-gem-release 0.9.0 reusable workflow with RubyGems Trusted Publishing and optional dry runs. The Intridea changelog handler dates the (Next) section and prepares the next patch version. Disable the local Bundler release tasks, load the version file relative to the gemspec so release fixtures build their own version, and cover the release with ruby-gem-release RSpec helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Gr21iR4JxWxGGyXdJ3uc9
406e3ee to
30d6dd6
Compare
Stacked on #83. Replaces the manual
rake releaseprocess with a manually dispatched ruby-gem-release 0.9.0 workflow that publishes through RubyGems Trusted Publishing, as in mongoid-history#280..github/workflows/release.ymlcalls the reusable workflow, but only from the default branch ofmongoid/mongoid-geospatial. It takes an optionalversioninput and adry-runinput. The test command starts amongo:8.0container beforebundle exec rakewhere specs need MongoDB.script/release.rbbuilds the workflow withRubyConstantandChangelog::Intridea. A release dates the(Next)heading, then adds the next patch(Next)section.release,release:rubygem_push, andrelease:source_control_push.require_relative, so release fixtures build their own version instead of the checkout's.spec/releaseruns a full local release and rejects sections with only the placeholder, using the upstream RSpec helpers and never contacting RubyGems or GitHub.masterstill called it7.4.2 (Next), and there is nov7.4.2tag. The pending notes may already have been released in 7.4.2; a maintainer should reconcile the changelog and tag./vendor/bundle:ruby/setup-rubywithbundler-cacheinstalls gems there, and the release's clean-checkout check otherwise rejects the run (see Ignore vendor/bundle mongoid-shell#33).Before the first release (not done in this PR): create the
releaseenvironment, add the RubyGems trusted publisher (mongoid/mongoid-geospatial,release.yml, environmentrelease, workflow repositorydblock/ruby-gem-release), and allow Actions to push to the default branch. Then verify the setup withgh workflow run release.yml -R mongoid/mongoid-geospatial -f dry-run=true.Validation:
bundle exec rakeon Ruby 4.0.9 with local MongoDB: 61 files inspected, no offenses detected 168 examples, 0 failuresactionlintpasses.This PR was written by an AI (Claude) on behalf of @dblock.
🤖 Generated with Claude Code
https://claude.ai/code/session_011Gr21iR4JxWxGGyXdJ3uc9