Skip to content

Commit 1d7ef02

Browse files
committed
Build PDF for release candidates, fixes JuliaLang/julia#45579.
1 parent 3c6c705 commit 1d7ef02

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

pdf/make.jl

+12-10
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const JULIA_DOCS_TMP = get(ENV, "JULIA_DOCS_TMP", "$(BUILDROOT)/tmp")
88

99
# download and extract binary for a given version, return path to executable
1010
function download_release(v::VersionNumber)
11-
x, y, z = v.major, v.minor, v.patch
11+
x, y = v.major, v.minor
1212
julia_exec = cd(BUILDROOT) do
13-
julia = "julia-$(x).$(y).$(z)-linux-x86_64"
13+
julia = "julia-$(v)-linux-x86_64"
1414
tarball = "$(julia).tar.gz"
15-
sha256 = "julia-$(x).$(y).$(z).sha256"
15+
sha256 = "julia-$(v).sha256"
1616
run(`curl -vo $(tarball) -L https://julialang-s3.julialang.org/bin/linux/x64/$(x).$(y)/$(tarball)`)
1717
run(`curl -vo $(sha256) -L https://julialang-s3.julialang.org/bin/checksums/$(sha256)`)
1818
run(pipeline(`grep $(tarball) $(sha256)`, `sha256sum -c`))
@@ -69,14 +69,13 @@ function copydocs(file)
6969
end
7070

7171
function build_release_pdf(v::VersionNumber)
72-
x, y, z = v.major, v.minor, v.patch
73-
@info "building PDF for Julia v$(x).$(y).$(z)."
72+
@info "building PDF for Julia v$(v)."
7473

75-
file = "julia-$(x).$(y).$(z).pdf"
74+
file = "julia-$(v).pdf"
7675

7776
# early return if file exists
7877
if isfile("$(JULIA_DOCS)/$(file)")
79-
@info "PDF for Julia v$(x).$(y).$(z) already exists, skipping."
78+
@info "PDF for Julia v$(v) already exists, skipping."
8079
return
8180
end
8281

@@ -85,7 +84,7 @@ function build_release_pdf(v::VersionNumber)
8584
julia_exec = download_release(v)
8685

8786
# checkout relevant tag and clean repo
88-
run(`git -C $(JULIA_SOURCE) checkout v$(x).$(y).$(z)`)
87+
run(`git -C $(JULIA_SOURCE) checkout v$(v)`)
8988
run(`git -C $(JULIA_SOURCE) clean -fdx`)
9089

9190
# invoke makedocs
@@ -121,12 +120,15 @@ function collect_versions()
121120
# lines are in the form 'COMMITSHA\trefs/tags/TAG'
122121
_, ref = split(line, '\t')
123122
_, _, tag = split(ref, '/')
124-
if occursin(r"^v\d+\.\d+\.\d+$", tag)
123+
if occursin(r"^v\d+\.\d+\.\d+(?:-rc\d+)?$", tag)
125124
# the version regex is not as general as Base.VERSION_REGEX -- we only build "pure"
126125
# versions and exclude tags that are pre-releases or have build information.
127126
v = VersionNumber(tag)
128127
# pdf doc only possible for 1.1.0 and above
129-
v >= v"1.1.0" && push!(versions, v)
128+
# only build rc if > 1.7
129+
if v >= v"1.1.0" && (isempty(v.prerelease) || v > v"1.7.0")
130+
push!(versions, v)
131+
end
130132
end
131133
end
132134
return versions

0 commit comments

Comments
 (0)