Add Julia registries only when not present

This commit is contained in:
Curtis Vogt
2024-01-09 14:58:51 -06:00
parent 90dd6f23eb
commit ab02b8f55c

View File

@@ -46,17 +46,22 @@ runs:
if VERSION >= v"1.5-" if VERSION >= v"1.5-"
if !any(r -> r.name == "General", Pkg.Registry.reachable_registries())
Pkg.Registry.add("General") Pkg.Registry.add("General")
end
# If provided add local registries # If provided add local registries
if !isempty("${{ inputs.localregistry }}") if !isempty("${{ inputs.localregistry }}")
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
for repo_url in local_repos for repo_url in local_repos
isempty(repo_url) && continue isempty(repo_url) && continue
# https://github.com/JuliaLang/Pkg.jl/issues/3753
if !any(r -> r.repo == repo_url, Pkg.Registry.reachable_registries())
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url)) Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
end end
end end
end end
end
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)() VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
shell: julia --color=yes --project=${{ inputs.project }} {0} shell: julia --color=yes --project=${{ inputs.project }} {0}