Skip to content

Commit

Permalink
Override default gem release task
Browse files Browse the repository at this point in the history
We don't want the `release:rubygem_push` task to execute at all. Previously we used `gem_push=no bundle exec rake release` for this.. but since we're customize `release` to _also_ create a GitHub release, let's just remove the RubyGem push to it will never accidentally trigger if someone forgets the `gem_push=no` ENV var.
  • Loading branch information
darronschall committed May 28, 2024
1 parent 38bc660 commit ae40231
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tasks/release.rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "date"
require "rake"
require "twirp/protoc_plugin/core_ext/string/to_anchor"

# See: https://github.com/rubygems/bundler-features/issues/81
# Remove the Bundler release task and override it with our own
Rake::Task["release"].clear

# Customize the release task originally defined at
# https://github.com/rubygems/rubygems/blob/v3.5.10/bundler/lib/bundler/gem_helper.rb#L67
#
# * Do NOT push to RubyGems (remove need to specify `gem_push=no` by
# removing `release:rubygem_push` dependency). The `release:source_control_push`
# task triggers a RubyGems release using our GitHub Action as a trusted publisher.
# * Create a GitHub release for the current version, with release notes
desc "Creates a release tag, pushes the tag to GitHub (which auto-releases to RubyGems), and creates a GitHub release."
task "release", [:remote] => %w[
build
release:guard_clean
release:source_control_push
release:create_github_release
]

desc "Gets the latest GitHub release version, e.g: v1.1.1"
task "release:latest_github_release" do
# We could use `git` here to get the most recent version tag, like:
Expand Down

0 comments on commit ae40231

Please sign in to comment.