Skip to content

Commit 398842b

Browse files
committed
Release all gems in dependency order using trusted publishing
1 parent 81bffe1 commit 398842b

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,29 @@ jobs:
2424
ruby-version: ruby
2525

2626
# Release
27-
- uses: rubygems/release-gem@v1
27+
#
28+
# We use rubygems/configure-rubygems-credentials directly rather than the
29+
# higher-level rubygems/release-gem action because this is a monorepo with
30+
# multiple gems that must be released in dependency order. The release-gem
31+
# action only supports a single gem (it runs `bundle exec rake release`
32+
# which would only release the last gem registered with GemHelper).
33+
#
34+
# We also skip the `release:source_control_push` task (git tagging) because
35+
# this workflow is triggered by a tag push — the tag already exists.
36+
#
37+
# rubygems/configure-rubygems-credentials exchanges the GitHub Actions OIDC
38+
# token for a temporary RubyGems API key, enabling trusted publishing without
39+
# storing any secrets.
40+
- name: Configure RubyGems credentials
41+
uses: rubygems/configure-rubygems-credentials@v2
42+
# Gems are released in dependency order so each gem is available on
43+
# RubyGems.org before any gem that depends on it is pushed.
44+
- name: Release gems in dependency order
45+
run: |
46+
bundle exec rake core:release:rubygem_push
47+
bundle exec rake dragonfly:release:rubygem_push
48+
bundle exec rake testing:release:rubygem_push
49+
bundle exec rake pages:release:rubygem_push
50+
bundle exec rake images:release:rubygem_push
51+
bundle exec rake resources:release:rubygem_push
52+
bundle exec rake release:rubygem_push

Rakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ require "bundler/gem_helper"
44
Bundler::GemHelper.install_tasks(name: "refinerycms")
55

66
%w[core dragonfly images pages resources testing].each do |sub_gem|
7-
Bundler::GemHelper.install_tasks(dir: sub_gem, name: "refinerycms-#{sub_gem}")
7+
namespace sub_gem do
8+
Bundler::GemHelper.install_tasks(dir: sub_gem, name: "refinerycms-#{sub_gem}")
9+
end
810
end
911

1012
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)

0 commit comments

Comments
 (0)