Skip to content

Commit 1e3c5d7

Browse files
authored
Build PDFs for beta pre-releases too (#27)
* Build PDFs for beta pre-releases too * Print more to the logs * Fix strings * exclude 1.9.0-beta1
1 parent 16a515e commit 1e3c5d7

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

pdf/make.jl

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ function download_release(v::VersionNumber)
1313
julia = "julia-$(v)-linux-x86_64"
1414
tarball = "$(julia).tar.gz"
1515
sha256 = "julia-$(v).sha256"
16-
run(`curl -vo $(tarball) -L https://julialang-s3.julialang.org/bin/linux/x64/$(x).$(y)/$(tarball)`)
17-
run(`curl -vo $(sha256) -L https://julialang-s3.julialang.org/bin/checksums/$(sha256)`)
18-
run(pipeline(`grep $(tarball) $(sha256)`, `sha256sum -c`))
16+
url = "https://julialang-s3.julialang.org/bin/linux/x64/$(x).$(y)/$(tarball)"
17+
sha_url = "https://julialang-s3.julialang.org/bin/checksums/$(sha256)"
18+
@info "Downloading release tarball." url sha_url
19+
run(`curl -fvo $(tarball) -L $(url)`)
20+
run(`curl -fvo $(sha256) -L $(sha_url)`)
21+
try
22+
run(pipeline(`grep $(tarball) $(sha256)`, `sha256sum -c`))
23+
catch e
24+
@info "Contents of SHA256 file:\n$(read(sha256, String))"
25+
rethrow(e)
26+
end
1927
mkpath(julia)
2028
run(`tar -xzf $(tarball) -C $(julia) --strip-components 1`)
2129
return abspath(julia, "bin", "julia")
@@ -27,7 +35,9 @@ function download_nightly()
2735
julia_exec, commit = cd(BUILDROOT) do
2836
julia = "julia-latest-linux64"
2937
tarball = "$(julia).tar.gz"
30-
run(`curl -vo $(tarball) -L https://julialangnightlies-s3.julialang.org/bin/linux/x64/$(tarball)`)
38+
url = "https://julialangnightlies-s3.julialang.org/bin/linux/x64/$(tarball)"
39+
@info "Downloading nightly tarball." url
40+
run(`curl -fvo $(tarball) -L $url`)
3141
# find the commit from the extracted folder
3242
folder = first(readlines(`tar -tf $(tarball)`))
3343
_, commit = split(folder, '-'); commit = chop(commit)
@@ -80,7 +90,6 @@ function build_release_pdf(v::VersionNumber)
8090
end
8191

8292
# download julia binary
83-
@info "downloading release tarball."
8493
julia_exec = download_release(v)
8594

8695
# checkout relevant tag and clean repo
@@ -95,7 +104,6 @@ function build_release_pdf(v::VersionNumber)
95104
end
96105

97106
function build_nightly_pdf()
98-
@info "downloading nightly tarball"
99107
julia_exec, commit = download_nightly()
100108
# output is "julia version 1.1.0-DEV"
101109
_, _, v = split(readchomp(`$(julia_exec) --version`))
@@ -120,16 +128,19 @@ function collect_versions()
120128
# lines are in the form 'COMMITSHA\trefs/tags/TAG'
121129
_, ref = split(line, '\t')
122130
_, _, tag = split(ref, '/')
123-
if occursin(r"^v\d+\.\d+\.\d+(?:-rc\d+)?$", tag)
131+
if occursin(r"^v\d+\.\d+\.\d+(?:-(:?rc|beta)\d+)?$", tag)
124132
# the version regex is not as general as Base.VERSION_REGEX -- we only build "pure"
125-
# versions and exclude tags that are pre-releases or have build information.
133+
# versions and exclude tags that are pre-releases (except for -rcN and -betaN) or
134+
# have build information.
126135
v = VersionNumber(tag)
127136
# pdf doc only possible for 1.1.0 and above
128137
v >= v"1.1.0" || continue
129138
# only build RCs if > 1.7
130139
v < v"1.7.0" && !isempty(v.prerelease) && continue
131140
# exclude 1.8.0 pre-releases, since those fail
132141
v"1.8.0-" < v < v"1.8.0" && continue
142+
# exclude 1.9.0-beta1, because it doesn't have a SHA file
143+
v == v"1.9.0-beta1" && continue
133144
push!(versions, v)
134145
end
135146
end

0 commit comments

Comments
 (0)