OnlinePackage

Interface

OnlinePackage.get_userFunction
get_user(user_file = USER_FILE)

Create a user profile from a TOML file. By default, looks in USER_FILE.

The file must contain a username, token, and ssh_keygen_file. See the sample.toml file in this repository for an example. It should look something like the following:

username = "YOUR_GITHUB_USERNAME"
token = "YOUR_GITHUB_TOKEN"
ssh_keygen_file = "PATH_TO_SSH_KEYGEN"

Use your github username.

Get a token here. Make sure to check the public_repo scope, and optionally, the delete_repo scope.

If ssh-keygen is in your path, just set ssh_keygen_file to "ssh-keygen". If not, it often comes prepacked with git; check PATH_TO_GIT/usr/bin/ssh-keygen".

source
OnlinePackage.put_onlineMethod
put_online(user::User, repo_name; key_names = ("COMPATHELPER_PRIV",))

Put a repository online: put it on github, and create SSH keys with names listed in key_names for use in various github actions. If the repository already exists, it will create a new set of keys.

julia> using OnlinePackage

julia> repo_name = "Test1.4.2.jl";

julia> user = get_user(OnlinePackage.SAMPLE_FILE);

julia> put_online(user, repo_name)

julia> put_online(user, repo_name)

julia> delete(user, repo_name)
source

Walk-through

Currently, OnlinePackage is only set up to handle GitHub accounts, but other platforms might be supported in the future.

The first step to use OnlinePackage is to fill out your user information. USER_FILE will be the location that OnlinePackage will look, so create that file.

The contents of the file should look like this:

username = "YOUR_GITHUB_USERNAME"
token = "YOUR_GITHUB_TOKEN"
ssh_keygen_file = "PATH_TO_SSH_KEYGEN"

See the documentation for get_user for information about how to create this information.

Then run

user = get_user()

to load the file. You can then put up a new package:

put_online(user, "YOUR_NEW_PACKAGE.jl")

OnlinePackage will automatically create SSH keys to enable various GitHub actions. The only key created by default is for CompatHelper: COMPATHELPER_PRIV. You can add as many additional keys as you like. For example, if you would also like a documenter key, you can run

put_online(user, "YOUR_NEW_PACKAGE.jl", key_names = ("COMPATHELPER_PRIV", "DOCUMENTER_KEY"))

Note that Documenter can use a generic GITHUB_TOKEN provided you enable github pages, so this is not strictly necessary.

You can also use OnlinePackage to add keys to previously existing packages. The syntax is the same as above: OnlinePackage will automatically detect an existing package.