JuliaHub has the ability to create private registries
Private registries require JuliaHub Team or Enterprise.
Use the Registrator to register new packages or new versions of existing packages.
Click on the "Grant Privileges" button to grant Registrator access to check whether you are a contributor on the package that you want to register. Grant Privileges button might not be present if Authorization is disabled for the registry
When your package registration is successful, if the registry is hosted on GitHub/GitLab/Bitbucket server, Registrator will create a registration pull request in the private registry. If server is Bare Git
, then a branch with the changes will be created in the registry repo, which needs to be manually converted into a pull request.
For a package registration to be valid the Project.toml
file in the package (or JuliaProject.toml
file) must contain valid name
, uuid
and version
fields. See here to find out how to generate a Project.toml
file. You can read more about package naming guidelines here.
The "Server Type" field is needed to specify type of Git server where the registry is hosted. This field would be auto-filled.
The "Directory" field is optional. This is used when you want to register a package that is contained in a sub-directory inside the repository. In this case you can enter the name of the directory if it is at the top level or the path to the directory if it is a nested directory. For example, packages/viz/DataViz.jl
. Note that you must use /
as the delimiter when you enter a path.
The "Tag/Branch" field defaults to the master
branch. You can enter a branch other than master
or you can enter a release tag. For example, v0.1.1
. This field indicates which branch or release tag Registrator will look at to create the registration pull request. In particular, Registrator will look at the version specified in the Project.toml
file in this branch or release tag. Registrator also retrieves a tree hash for this checkout which uniquely identifies the checkout. The version and tree hash are part of the registration pull request.
The "Release Notes" field is optional.
Availability of the package version on JuliaHub package server
JuliaHub will try syncing versions of the packages every 30 minutes. Please check JuliaHub Packages page to check whether the version is available for download.
Organization settings
Organization settings on GitHub can sometimes restrict third party OAuth applications like the JuliaHub Registrator from accessing private repositories. See Managing OAuth access to your organization's data.
Using a Registry from JuliaHub
To use a custom registry on your local machine, you will need to download an authentication token from the platform.
Adding the JuliaHub registry
Start a Julia session and install the PkgAuthentication
package. This package can be used for both initial setup and to stay connected to the registry.
using Pkg
Pkg.add("PkgAuthentication")
Next, configure Julia to be aware of http://juliahub.com's package server:
using PkgAuthentication
PkgAuthentication.install("juliahub.com")
Then add all known registries on https://juliahub.com, including the JuliaHub registry, using the command:
Pkg.Registry.add()
The command above will only work on Julia v1.8 and later. On versions prior to v1.8 use the pkg>
REPL command registry add
instead.
This will open up a new browser window or tab and ask you to sign in to https://juliahub.com or to confirm authenticating as an already logged in user.
Once logged in, the browser tab can be closed. Julia will be authenticated with the package server at https://juliahub.com and download all available registries.
This will also change the package server to https://juliahub.com for all Julia sessions that run startup.jl
.
Staying connected to the JuliaHub registry
The authentication token will expire after a while, so it is convenient to enable an automatic mechanism for renewal. This can be achieved using the previously installed PkgAuthentication
package, by adding the following snippet to your local <home directory>/.julia/config/startup.jl
file.
Base.eval(Module(), quote
using PkgAuthentication
PkgAuthentication.install("juliahub.com")
end)
This will ensure that whenever a Pkg
operation is performed that an up-to-date authentication token is available either silently or through another browser interaction.
Common errors
Registering a version that already exists in the registry
Registering a package version that already exists in the registry is not allowed. You have to use a different version number in order for the registration to be valid.
Changing the package URL
You cannot register a new version of a package by using a package URL that is different from what the package was previously registered with. If such a change is necessary then it must be made by directly editing the private registry. It is recommended to create a pull request to the private registry with the required URL change. Once the URL change is done you can proceed with your registration.