Skip to content

Commit dae5769

Browse files
joelhawksleyCopilot
andcommitted
Fix release script bundler frozen mode and docs build error handling
setup-ruby's `bundler-cache: true` sets frozen mode, which prevents `bundle install` from updating Gemfile.lock after script/release bumps the gemspec version. The stale lockfile then makes `bundle exec rake docs:build` fail with: The gemspecs for path gems changed, but the lockfile can't be updated because frozen mode is set Because the script had no error handling on that command, the failure was silently ignored and the release PR was pushed with unbuilt docs. Fix both problems: - Export BUNDLE_FROZEN=false and BUNDLE_DEPLOYMENT=false at the top of the script so every bundler invocation can rewrite the lockfile. - Switch `update_gemfiles` from `bundle` (install) to `bundle lock`, matching the appraisal loop — we only need the lockfile refreshed, gems are already installed by setup-ruby. - Fail the script when `sync_contributors.rb` or `rake docs:build` returns non-zero, so a broken release cannot be pushed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
1 parent aaca93b commit dae5769

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎script/release‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# bundler-cache: true in setup-ruby enables frozen mode, which blocks
4+
# updating Gemfile.lock after the gemspec version bump. Disable it for
5+
# every bundler invocation in this script so the lockfile can be
6+
# regenerated to match the new version.
7+
export BUNDLE_FROZEN=false
8+
export BUNDLE_DEPLOYMENT=false
9+
310
fetch() {
411
git fetch --all
512
}
@@ -54,8 +61,10 @@ update_ruby_version() {
5461
}
5562

5663
update_gemfiles() {
57-
# Update Gemfile.lock
58-
bundle
64+
# Update Gemfile.lock. Use `bundle lock` (not `bundle install`) so we
65+
# only rewrite the lockfile with the new version — no gem installs
66+
# needed, and it avoids re-triggering the bundler-cache frozen check.
67+
bundle lock
5968

6069
# Update appraisal gemfile locks.
6170
# BUNDLE_IGNORE_RUBY_VERSION is needed because the gemfiles declare ruby
@@ -66,8 +75,8 @@ update_gemfiles() {
6675
}
6776

6877
build_docs() {
69-
ruby script/sync_contributors.rb
70-
bundle exec rake docs:build
78+
ruby script/sync_contributors.rb || { echo "Error: sync_contributors.rb failed"; exit 1; }
79+
bundle exec rake docs:build || { echo "Error: rake docs:build failed"; exit 1; }
7180
}
7281

7382
add_changed_files() {

0 commit comments

Comments
 (0)