Hi all,
I’m trying to get OnlinePackage to be able to post a package on github, but also set up the necessary SSH keys to get documenter building. I had it working on travis, but now I’m trying to get it work with github actions.
The new wrinkle is the github actions API requires “secrets” be uploaded via libsodium. Julia has a Sodium.jl wrapper library but it is very out of date…
Anyway, I used binary builder to build libsodium so you can download it now using libsodium_jll
. Now I’m trying to call its functions via ccall. I’ve never used ccall before, so I’m not sure if I’m doing it right…
The relevant part of the function is here:
sodium_key_id = json_string(talk_to(HTTP.get, github_remote,
"/repos/$username/$repo_name/actions/secrets/public-key"
))
sodium_key = base64decode(sodium_key_id["key"])
raw_encoded = Vector{UInt8}(undef,
length(private_key) +
ccall((:crypto_box_sealbytes, libsodium), Cint, ())
)
error_code = ccall(
(:crypto_box_seal, libsodium),
Int32,
(Ptr{UInt8}, Cstring, Cint, Ptr{UInt8}),
raw_encoded, private_key, length(private_key), sodium_key
)
if error_code != 0
error("Error using libsodium.crypto_box_seal")
end
talk_to(
HTTP.put, github_remote, "/repos/$username/$repo_name/actions/secrets/$key_name",
encrypted_value = base64encode(unsafe_string(pointer(raw_encoded), length(raw_encoded))),
key_id = sodium_key_id["key_id"]
)
Unfortunately, it doesn’t seem to be enough to get documenter building. I’m getting the error:
Load key "/home/runner/work/JuliennedArrays.jl/JuliennedArrays.jl/docs/.documenter": invalid format
git@github.com: Permission denied (publickey).
The full function is on the github repo here:
You can see a failing documenter build here:
https://github.com/bramtayl/JuliennedArrays.jl/runs/451494597
The github secrets api documentation is here:
and the libsodium sealed box documentation is here:
Can anyone give some advice about what to do next?