feat(release-to-candidate): Support projects that doesn't specify the version property#46
Conversation
… `version` property It is possible that the Snapcraft project doesn't specify the `version` property in the snapcraft.yaml, instead setting the snap version string via the `craftctl set version=_version` mechanism. In this case the parse-snapcraft-yaml job will set the version variable to `null`, making the release-to-candidate job unable to detect the built snap due to filename mismatch. This patch enhances the release-to-candidate job so that the built snap will still be matched via filename matching. Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
|
Failing on projects that don't specify a version is more of a design choice than an oversight. Ideally we'd like projects to be pulling versioned releases from tags, and having the version set makes it easier for us to automatically bump versions and trigger rebuilds. |
Yeah this is rather a change for non-Snapcrafters projects(e.g. tesserarct-snap) with a different upstream version select strategy(e.g. selective-checkout) to work without implementing their own release-to-{candidate,beta,edge} GH action jobs. I'm currently working with the Tesseract OCR upstream to re-enable their snap distribution and would like to reuse the Snapcrafters automation when possible. |
Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
|
The |
…ify the `version` property Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
Avoid parameter expansion result being treated as a filename pattern. Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
|
I'm going to close this - per my early comment, requiring a version in the snapcraft.yaml is a deliberate choice that increases the chance of build reproducibility. While it would be good to expand to support any possible use-cases, doing so also increases complexity that we'll need to maintain. These workflows are permissively licensed, so if anyone wanted to use them with slight modifications to not require a version, they can do so by forking and making those changes. |
It is possible that the Snapcraft project doesn't specify the
versionproperty in the snapcraft.yaml, instead of setting the snap version string via thecraftctl set version=_version_mechanism. In this case, the parse-snapcraft-yaml job will set the version variable tonull, making the release-to-candidate job unable to detect the built snap due to a filename mismatch:This patch enhances the release-to-candidate job so that the built snap will still be matched via filename matching.
Although projects that don't specify the
versionproperty aren't really compliant with the Snapcrafters policy, supporting this use case allows external projects to reuse the snapcrafters/ci/release-to-candidate GitHub Action job without the need to fork the project.