You can compute the git tree hash with Pkg.GitTools.tree_hash. You can see artifacts documentation about how to automatically generate an Artifacts.toml file.
Since you want to distribute a shared library, have you considered using BinaryBuilder.jl instead? If you need some inspiration, there are hundreds of recipes already available in Yggdrasil