Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 5.08 KB

RELEASING.md

File metadata and controls

60 lines (36 loc) · 5.08 KB

Releasing mongoid_fulltext

Releases use ruby-gem-release 0.9.0 through a manually dispatched Release workflow. Keep the ruby-gem-release gem in Gemfile and the reusable workflow in release.yml pinned to the same version. The workflow publishes through RubyGems Trusted Publishing, so no RubyGems API key or one-time password is needed. It only runs from master in mongoid/mongoid_fulltext.

The local Bundler rake release, release:rubygem_push, and release:source_control_push tasks are disabled so that releases only happen through the workflow.

One-Time Setup

Before the first automated release, a maintainer must:

  1. Create the GitHub environment release in mongoid/mongoid_fulltext, for example with gh api --method PUT repos/mongoid/mongoid_fulltext/environments/release, and restrict its deployment branches to master. Add required reviewers to the environment to require maintainer approval before publication.
  2. At mongoid_fulltext's trusted publishers, add a GitHub Actions publisher with repository owner mongoid, repository mongoid_fulltext, workflow filename release.yml, environment release, and the separate workflow repository owner dblock and repository ruby-gem-release.
  3. Allow GitHub Actions to push release commits and v* tags to master. The workflow uses GITHUB_TOKEN with contents: write and id-token: write, and pushes the release commit and the next development version directly to master. See the upstream setup and permissions guidance.

Installing the workflow does not apply these settings. To verify them without publishing, run a dry run. It checks release prerequisites, including Trusted Publishing, without editing files, building, pushing, or publishing:

gh workflow run release.yml --repo mongoid/mongoid_fulltext --ref master -f dry-run=true

Prepare

Start with a clean, up-to-date master, and verify that the latest CI checks pass for all supported Ruby, Mongoid, and MongoDB versions. Review CHANGELOG.md, UPGRADING.md, and README.md for new features.

Follow semantic versioning: patch for fixes, minor for backward-compatible features, major for breaking changes. Check Mongoid::FullTextSearch::VERSION in lib/mongoid/full_text_search/version.rb, and the matching ### x.y.z (Next) heading in CHANGELOG.md. Change both in a pull request, or pass a version override when dispatching.

Keep the (Next) heading. The workflow dates it using YYYY/MM/DD and removes the * Your contribution here. placeholder if present. A section with no notes cannot be released.

Release automation requires MRI Ruby 3.3 or newer; the release dependency and tasks are skipped on older Ruby versions and JRuby. Release specs in spec/release run the actual release tasks against a local fixture, using the ruby-gem-release RSpec helpers, without contacting RubyGems or GitHub.

bundle install
bundle exec rake

Publish

Dispatch the checked-in version:

gh workflow run release.yml --repo mongoid/mongoid_fulltext --ref master

To release a different version, pass an override:

gh workflow run release.yml --repo mongoid/mongoid_fulltext --ref master -f version=1.0.0

Dispatching starts a real release, not a dry run. Do not merge into master while a release runs.

The workflow prepares the release commit, starts MongoDB 8.0, runs RuboCop and specs with Mongoid 9 on Ruby 3.3, builds the gem, preserves recovery artifacts, publishes to RubyGems, pushes the release commit and v tag, and creates a GitHub Release with the changelog notes and the gem attached. It then increments the patch version, adds a new (Next) section with the placeholder, and pushes the next development commit to master. For a planned minor or major next version, change it in a later pull request.

Verify the published version on RubyGems, the tag, the GitHub Release, and the next development commit. The workflow does not replace the full CI matrix.

Recover a Partial Release

Inspect the failed run, RubyGems, remote commits and tags, and the GitHub Release before retrying. Publication may have succeeded even if a later Git push or next development commit failed. Never move a published tag or republish a version with different contents.

Use the run's retained recovery artifacts and the upstream recovery instructions to finish the release with the exact prepared commit and gem.