A tool for package developers for working with artifacts.
56 Stars
Updated Last
1 Year Ago
Started In
October 2020


Stable Dev Build Status Coverage pkgeval

Provides the function add_artifact!, which makes it easy for Julia projects to ship their own tarballs as Artifacts.


This will download the JuliaMono font from GitHub as a tarball and create a corresponding Artifacts.toml file in the current directory. It allows any Julia code in that directory to access these files with the artifact"..." string macro.

julia> using ArtifactUtils, Artifacts # Artifacts provides the artifact string macro

julia> add_artifact!(

julia> import Pkg; Pkg.ensure_artifact_installed("JuliaMono", "Artifacts.toml")
  Downloaded artifact: JuliaMono
  Downloaded artifact: JuliaMono

julia> artifact"JuliaMono"

julia> run(`ls $ans`);
JuliaMono-Black.ttf	 JuliaMono-Bold.ttf	  JuliaMono-Light.ttf	JuliaMono-RegularLatin.ttf  LICENSE
JuliaMono-BoldLatin.ttf  JuliaMono-ExtraBold.ttf  JuliaMono-Medium.ttf	JuliaMono-Regular.ttf

Archive a directory and upload it to gist

You can create an artifact from a directory using artifact_from_directory and then upload it to gist with upload_to_gist. Note that upload_to_gist requires login with the GitHub CLI gh.

julia> using ArtifactUtils

julia> tempdir = mktempdir();

julia> write(joinpath(tempdir, "file"), "hello");

julia> artifact_id = artifact_from_directory(tempdir)

julia> gist = upload_to_gist(artifact_id)
- Creating gist...
✓ Created gist
Cloning into '.'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
Switched to a new branch '__tmp__'
[__tmp__ (root-commit) f5a58a9] Initial commit
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at f5a58a9 Initial commit
[master 44dfe9a] Add files
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 538e83d637ab07ada6d841aa2454e0d5af4e52b3.tar.gz
Counting objects: 5, done.
Delta compression using up to 128 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 455 bytes | 455.00 KiB/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
 + 2668e40...44dfe9a master -> master (forced update)
upload_to_gist(SHA1("538e83d637ab07ada6d841aa2454e0d5af4e52b3")) →

git-tree-sha1 = "538e83d637ab07ada6d841aa2454e0d5af4e52b3"

    sha256 = "a530e9f7e371eeea4aa4fbce83a00ed32233b7766314670b1c0779eb46a7b68d"
    url = ""

You can copy-and-paste the printed artifact fragment into your Artifacts.toml file. You can also call add_artifact! with the gist result object.

julia> add_artifact!("Artifacts.toml", "hello_world", gist)

Used By Packages

No packages found.