Skip to content

Commit 4b5c0c8

Browse files
committed
Update release to support providing JRUBY_LAST_VERSION so if a security release or non-major release it will still update files properly
1 parent 1f3a001 commit 4b5c0c8

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

rakelib/release.rake

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,24 @@ def create_post(version)
150150
end
151151

152152
def change_versions_in(filename, version, post_link)
153-
# we recalc this each time but this is a rakefile :)
154-
major, second, third, minor = version.split('.')
155-
156-
fail "third value is not a number: #{third}" unless third =~ /\d+/
157-
previous_third = third.to_i - 1
158-
previous_version = [major, second, previous_third, minor].join('.')
153+
if ENV['JRUBY_LAST_VERSION']
154+
previous_version = ENV['JRUBY_LAST_VERSION']
155+
else
156+
# we recalc this each time but this is a rakefile :)
157+
major, second, third, minor = version.split('.')
158+
159+
fail "third value is not a number: #{third}" unless third =~ /\d+/
160+
previous_third = third.to_i - 1
161+
previous_version = [major, second, previous_third, minor].join('.')
162+
end
159163

160164
windows_version = version.gsub('.', '_')
161165
previous_windows_version = previous_version.gsub('.', '_')
162166

167+
previous_link_version = previous_version.gsub('.', '-')
168+
163169
# format to match <a href='/2025/01/21/jruby-9-4-10-0'>release notes</a>
164-
previous_link_re = %r{/\d+\/\d+\/\d+\/jruby\-#{major}\-#{second}\-#{previous_third}\-#{minor}}
170+
previous_link_re = %r{/\d+\/\d+\/\d+\/jruby\-#{previous_link_version}}
165171
puts previous_link_re
166172

167173
# We use full versions since we are doing simple text replacement. Only

0 commit comments

Comments
 (0)