I don’t recall ever doing it, but I don’t see why it’s not possible. I’d follow the pre-built but instead of having a
source: which is an upstream binary tarball, maybe link to a directory containing your shell script. Make the
apps: section point to the script inside the snap.