mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 01:16:54 +08:00
Fix add_general_registry (#28)
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -15,7 +15,6 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -31,6 +30,9 @@ jobs:
|
|||||||
arch:
|
arch:
|
||||||
- x64
|
- x64
|
||||||
- x86
|
- x86
|
||||||
|
pkg-server:
|
||||||
|
- ""
|
||||||
|
- "pkg.julialang.org"
|
||||||
# 32-bit Julia binaries are not available on macOS
|
# 32-bit Julia binaries are not available on macOS
|
||||||
exclude:
|
exclude:
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
@@ -68,6 +70,8 @@ jobs:
|
|||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- uses: ./.github/actions/julia-buildpkg
|
- uses: ./.github/actions/julia-buildpkg
|
||||||
|
env:
|
||||||
|
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
|
||||||
|
|
||||||
- uses: julia-actions/julia-runtest@v1
|
- uses: julia-actions/julia-runtest@v1
|
||||||
|
|
||||||
|
|||||||
@@ -25,14 +25,8 @@ runs:
|
|||||||
# * https://github.com/JuliaLang/Pkg.jl/issues/2011
|
# * https://github.com/JuliaLang/Pkg.jl/issues/2011
|
||||||
# * https://github.com/JuliaRegistries/General/issues/16777
|
# * https://github.com/JuliaRegistries/General/issues/16777
|
||||||
# * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
|
# * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
|
||||||
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.jl
|
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.buildpkg.jl
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
# We set `JULIA_PKG_SERVER` only for this step to enforce
|
|
||||||
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
|
|
||||||
# the request metadata to pkg.julialang.org when installing
|
|
||||||
# packages via `Pkg.test`.
|
|
||||||
JULIA_PKG_SERVER: ""
|
|
||||||
|
|
||||||
- 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'
|
- 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'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -18,22 +18,35 @@ function general_registry_exists()
|
|||||||
if isfile(general_registry_tarball) && isfile(registry_toml_file)
|
if isfile(general_registry_tarball) && isfile(registry_toml_file)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
general_registry_dir, registry_toml_file = cloned_general_registry_location()
|
general_registry_dir, registry_toml_file = cloned_general_registry_location()
|
||||||
if !isdir(general_registry_dir)
|
if isdir(general_registry_dir) && isfile(registry_toml_file)
|
||||||
return false
|
|
||||||
elseif !isfile(registry_toml_file)
|
|
||||||
return false
|
|
||||||
else
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function add_general_registry()
|
function add_general_registry()
|
||||||
@info("Attempting to clone the General registry")
|
@info("Attempting to install the General registry")
|
||||||
general_registry_dir, registry_toml_file = general_registry_location()
|
|
||||||
|
general_registry_tarball, registry_toml_file = tarball_general_registry_location()
|
||||||
|
rm(general_registry_tarball; force = true, recursive = true)
|
||||||
|
rm(registry_toml_file; force = true, recursive = true)
|
||||||
|
|
||||||
|
general_registry_dir, registry_toml_file = cloned_general_registry_location()
|
||||||
rm(general_registry_dir; force = true, recursive = true)
|
rm(general_registry_dir; force = true, recursive = true)
|
||||||
Pkg.Registry.add("General")
|
|
||||||
isfile(registry_toml_file) || throw(ErrorException("the Registry.toml file does not exist"))
|
# If not already set, We set `JULIA_PKG_SERVER` to enforce
|
||||||
|
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
|
||||||
|
# the request metadata to pkg.julialang.org when installing
|
||||||
|
# packages via `Pkg.test`.
|
||||||
|
pkg_server = get(ENV, "JULIA_PKG_SERVER", "")
|
||||||
|
withenv("JULIA_PKG_SERVER" => pkg_server) do
|
||||||
|
Pkg.Registry.add("General")
|
||||||
|
end
|
||||||
|
|
||||||
|
general_registry_exists() || throw(ErrorException("The Registry was not intalled properly"))
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
Reference in New Issue
Block a user