I have a maven project that builds via GitHub action, and it uses semantic versioning to uniquely identify the build output. It is provided as generic zip and tgz files as well as native installers for Debian, Windows and MacOS.
Now I want to add snap building, too. It seems here I need to hand over control to snapcraft.io which listens to changes in my GitHub repository and builds on it’s own. But how do I ensure the correct semantic versioning is being used? After all I use gitversion to automatically calculate the version, and it ripples through my GitHub actions workflow via environment variables.
How can this version number be communicated to the snapcraft build?
Where it the version will be either the tag responding to the git commit, or it’s hash + current date if there isn’t one for the exact commit you’re building.
craftctl works for Core22 snaps but previous releases use a slightly different format that you might need to look around on the forums for examples for (iirc, snapcraftctl)