CompatHelper.main
— Functionmain(
env::AbstractDict=ENV,
ci_cfg::CIService=auto_detect_ci_service(; env=env);
entry_type::EntryType=KeepEntry(),
registries::Vector{Pkg.RegistrySpec}=DEFAULT_REGISTRIES,
use_existing_registries::Bool=false,
depot::String=DEPOT_PATH[1],
subdirs::AbstractVector{<:AbstractString}=[""],
master_branch::Union{DefaultBranch,AbstractString}=DefaultBranch(),
bump_compat_containing_equality_specifier=true,
pr_title_prefix::String="",
include_jll::Bool=false,
unsub_from_prs=false,
cc_user=false,
bump_version=false,
include_yanked=false,
)
Main entry point for the package.
Arguments
env::AbstractDict=ENV
: Optional dictionary of environment variables, see README for overviewci_cfg::CIService=auto_detect_ci_service(; env=env)
: CI Configuration, default to what is auto-detected
Keywords
entry_type::EntryType=KeepEntry()
: How to handle bumps for entry typesregistries::Vector{Pkg.RegistrySpec}=DEFAULT_REGISTRIES
: RegistrySpec of all registries to useuse_existing_registries::Bool=false
: Specify whether to use the registries available at thedepot
locationdepot::String=DEPOT_PATH[1]
: The user depot path to usesubdirs::AbstractVector{<:AbstractString}=[""]
: Subdirectories for nested packagesmaster_branch::Union{DefaultBranch,AbstractString}=DefaultBranch()
: Name of the master branchbump_compat_containing_equality_specifier=true
: Bump compat entries with equality specifierspr_title_prefix::String=""
: Prefix for pull request titlesinclude_jll::Bool=false
: Include JLL packages to bumpunsub_from_prs=false
: Unsubscribe the user from the pull requestscc_user=false
: CC the user on the pull requestsbump_version=false
: When set to true, the version in Project.toml will be bumped if a pull request is made. Minor bump if >= 1.0, or patch bump if < 1.0include_yanked=false
: When set to true, yanked versions will be included when calculating what the latest version of a package is
CompatHelper.jl
CompatHelper is a Julia package that helps you keep your [compat]
entries up-to-date. Whenever one of your package's dependencies releases a new breaking version, CompatHelper opens a pull request on your repository that modifies your [compat]
entry to reflect the newly released version. We would like to eventually add Julia support to Dependabot. If you would like to help with adding Julia support to Dependabot, join us in the #dependabot
channel on the Julia Language Slack.
Installation
GitHub
Create a file at .github/workflows/CompatHelper.yml
with the contents of the CompatHelper.yml that is included in this repository.
If you need to use any special arguments for the main
function, you can modify this file to add them.
GitLab
For GitLab you will want to add CompatHelper as a job in your .gitlab-ci.yml
file such as:
CompatHelper:
image: julia:1.6 # Set to the Julia version you want to use
stage: compat # You can place this in any stage that makes sense for your setup
before_script:
- apt-get update -qq && apt-get install -y git
- |
julia --color=yes -e "
import Pkg;
name = \"CompatHelper\";
uuid = \"aa819f21-2bde-4658-8897-bab36330d9b7\";
version = \"3\";
Pkg.add(; name, uuid, version)"
script:
- |
julia --color=yes -e "
import CompatHelper;
CompatHelper.main()"
Similarly to the GitHub setup, you can modify the main
call here if you need to change any of the default arguments. You must also remember to add the GITLAB_TOKEN
and COMPATHELPER_PRIV
CI secrets to the project so that CompatHelper can find them.
Creating SSH Key
If you use GitHub Actions to either test your package using continuous integration, or build and deploy documentation you will need to create an SSH deploy key. If you wish to reuse an existing SSH key simplify modify the workflow above environment variable to use COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
. Otherwise follow the below instructions to generate a new key,
- Generate a new SSH key
ssh-keygen -m PEM -N "" -f compathelper_key
- Create a new GitHub secret
- Copy the private key,
cat compathelper_key
- Go to your repositories settings page
- Select
Secrets
, andNew Repository Secret
- Name the secret
COMPATHELPER_PRIV
, paste the copied private key
- Copy the private key,
- Create a new deploy key
- Copy the public key,
cat compathelper_key.pub
- Go to your repositories settings page
- Select
Deploy Keys
, andAdd Deploy Key
- Name the deploy key
COMPATHELPER_PUB
, paste in the copied public key - Ensure that the key has
Write Access
- Copy the public key,
- Cleanup the SSH key from your computer,
rm -f compathelper_key compathelper_key.pub
Base64 SSH Public Key
CompatHelper also supports Base64 encoded SSH Public Keys. One reason for this would be for GitLab usage. On GitLab, if you add an SSH privary key to the CI secrets, if for any reason it prints out, it will show up in the log in plain text. To fix this, you can encode the private key in Base64 which is a format that GitLab can mask in log files.
Once you have created your SSH Public Key as mentioned above, before you delete it, you can convert it to Base64 like so:
openssl enc -base64 -in compathelper_key.pub -out compathelper_key.pub.base64
You can then use the Base64 version in your CI Secret rather than the plain text version. Once that is done, you can delete it from your computer.