Multiple snapcraft.yaml files

We want to publish two variants of our software one based one CPython and the other on PyPy. Is there a way that I could tell snapcraft to use a specific snapcraft.yaml file ?

In the past we have “worked around” this by creating a separate repository for snap packaging, that works well for open-source project but can be problematic for close-source one’s

I would like to know how to do that. Flatpak allows to indicate what is the “recipe”. I created a snap for a tool called “kubectx”. The stable release is a shell script. The newer implementation is in Go, so two complete different snapcraft.yaml files (but just one repository). My idea would be to generate two snaps to upload to two tracks (“bash” and “go”). I want to keep the snapcraft.yaml files together with the source code.

We’re facing the same issue in the ubuntu desktop installer, where we’re currently using a symbolic link in the repo’s root directory that is pointed to the snap directory of a given package before running snapcraft. (See e.g. here).

I’d be happy to know if there’s a better solution to maintain multiple snaps in the same repo.