I’m trying to figure out how to create an
Artifacts.toml to download some data that my package depends on. I’m creating a
setup_artifacts.jl script to create it.
Here’s what I have so far:
using Pkg.Artifacts using Pkg.GitTools using Tar toml = joinpath(@__DIR__, "Artifacts.toml") ir_url = "https://tidmarsh.media.mit.edu/~sfr/tidmarsh_irs.tar.gz" ir_hash = create_artifact() do artifact_dir tarball = download(ir_url) try global tarball_hash = bytes2hex(GitTools.blob_hash(tarball)) Tar.extract(tarball, artifact_dir) finally rm(tarball) end end bind_artifact!(toml, "tidmarsh_irs", ir_hash; download_info=[(ir_url, tarball_hash)], lazy=true)
My goal here is to have an Artifacts.toml file that I can include with my package that will download the referenced file and unpack it, making the contents (a bunch of
.flac files in my case) available at runtime.
Tar.extract is choking on the tarball ("invalid octal digit:
G"), perhaps because it’s compressed?
Also - is this the right way to be doing this? I’m trying to adapt the blog post here but it doesn’t seem like the examples set the URL that the artifacts can be downloaded from.