Skip to content

Commit ffd6a26

Browse files
committed
Use eager Pkg server registry instead of git cloning
This patch removes the git cloning of General and instead uses the eager registry flavor. In addition, the action exits early if no deps/build.jl file exist.
1 parent 252d468 commit ffd6a26

File tree

2 files changed

+9
-86
lines changed

2 files changed

+9
-86
lines changed

action.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@ inputs:
1717
runs:
1818
using: 'composite'
1919
steps:
20-
# Occasionally, there are rather large delays (> a few hours)
21-
# between the time a package is registered in General and
22-
# propagated to pkg.julialang.org. We can avoid this by manually
23-
# cloning ~/.julia/registries/General/ in Julia 1.5 and later.
24-
# See:
25-
# * https://github.com/JuliaLang/Pkg.jl/issues/2011
26-
# * https://github.com/JuliaRegistries/General/issues/16777
27-
# * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
28-
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.buildpkg.jl
29-
shell: bash
30-
31-
- run: julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
32-
shell: bash
20+
- run: |
21+
# Do nothing if no build file
22+
isfile("deps/build.jl") || exit()
23+
# Use "eager" registry flavor by default
24+
ENV["JULIA_PKG_SERVER_REGISTRY_PREFERENCE"] = get(ENV, "JULIA_PKG_SERVER_REGISTRY_PREFERENCE", "eager")
25+
import Pkg
26+
VERSION >= v"1.5-" && Pkg.Registry.add("General")
27+
VERSION >= v"1.1.0-rc1" ? Pkg.build(verbose=true) : Pkg.build()
28+
shell: julia --color=yes --project=${{ inputs.project }} {0}
3329
env:
3430
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"

add_general_registry.buildpkg.jl

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)