Skip to content

Commit 3413e46

Browse files
committed
Automate more steps for major release
1 parent 48741d8 commit 3413e46

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

rakelib/release.rake

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,61 @@ def update_for_version(version, major=true)
7979
post_link = create_post(version)
8080
change_versions_in('_config.yml', version, post_link)
8181
change_versions_in('download.html', version, post_link)
82+
update_links(version)
83+
end
84+
85+
def update_links(version)
86+
windows_version = version.gsub('.', '_')
87+
downloads_dir = "files/downloads"
88+
dir = "#{downloads_dir}/#{version}"
89+
mkdir_p dir
90+
File.write "#{dir}/index.html", <<"EOS"
91+
---
92+
layout: main
93+
title: Files/downloads/#{version}
94+
---
95+
<h1>Files/downloads/#{version}</h1>
96+
<p class="trackDownloads">
97+
<a href='/files/downloads/index.html'>..</a><br/>
98+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.tar.gz'>jruby-bin-#{version}.tar.gz</a><br/>
99+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.tar.gz.md5'>jruby-bin-#{version}.tar.gz.md5</a><br/>
100+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.tar.gz.sha1'>jruby-bin-#{version}.tar.gz.sha1</a><br/>
101+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.tar.gz.sha256'>jruby-bin-#{version}.tar.gz.sha256</a><br/>
102+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.zip'>jruby-bin-#{version}.zip</a><br/>
103+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.zip.md5'>jruby-bin-#{version}.zip.md5</a><br/>
104+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.zip.sha1'>jruby-bin-#{version}.zip.sha1</a><br/>
105+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-bin.zip.sha256'>jruby-bin-#{version}.zip.sha256</a><br/>
106+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar'>jruby-complete-#{version}.jar</a><br/>
107+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar.md5'>jruby-complete-#{version}.jar.md5</a><br/>
108+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar.sha1'>jruby-complete-#{version}.jar.sha1</a><br/>
109+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{version}/jruby-complete-#{version}.jar.sha256'>jruby-complete-#{version}.jar.sha256</a><br/>
110+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-src.zip'>jruby-src-#{version}.zip</a><br/>
111+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-src.zip.md5'>jruby-src-#{version}.zip.md5</a><br/>
112+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-src.zip.sha1'>jruby-src-#{version}.zip.sha1</a><br/>
113+
<a href='https://repo1.maven.org/maven2/org/jruby/jruby-dist/#{version}/jruby-dist-#{version}-src.zip.sha256'>jruby-src-#{version}.zip.sha256</a><br/>
114+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_#{windows_version}.exe'>jruby_windows_#{windows_version}.exe</a><br/>
115+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_#{windows_version}.exe.md5'>jruby_windows_#{windows_version}.exe.md5</a><br/>
116+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_#{windows_version}.exe.sha1'>jruby_windows_#{windows_version}.exe.sha1</a><br/>
117+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_#{windows_version}.exe.sha256'>jruby_windows_#{windows_version}.exe.sha256</a><br/>
118+
119+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_x64_#{windows_version}.exe'>jruby_windows_x64_#{windows_version}.exe</a><br/>
120+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_x64_#{windows_version}.exe.md5'>jruby_windows_x64_#{windows_version}.exe.md5</a><br/>
121+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_x64_#{windows_version}.exe.sha1'>jruby_windows_x64_#{windows_version}.exe.sha1</a><br/>
122+
<a href='https://s3.amazonaws.com/jruby.org/downloads/#{version}/jruby_windows_x64_#{windows_version}.exe.sha256'>jruby_windows_x64_#{windows_version}.exe.sha256</a><br/>
123+
</p>
124+
EOS
125+
126+
# This is a bit fast and loose on error handling but this is modifying
127+
# a file in a git repo. We can always go to previous commit if some
128+
# intermittent error occurs
129+
index_file = "#{downloads_dir}/index.html"
130+
contents = File.read(index_file)
131+
contents.gsub! /<!-- NEW_VERSION -->/, <<"EOS"
132+
<a href='/files/downloads/#{version}/index.html'>#{version}</a><br/>
133+
<!-- NEW_VERSION -->
134+
EOS
135+
136+
File.write index_file, contents
82137
end
83138

84139
def create_post(version)

0 commit comments

Comments
 (0)