Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snap] Set the snap package version using git tag instead of VERSION file #357

Open
chanchiwai-ray opened this issue Apr 2, 2024 · 0 comments

Comments

@chanchiwai-ray
Copy link
Contributor

chanchiwai-ray commented Apr 2, 2024

The snapcraft.yaml uses the VERSION file to indicate the version of the snap package, but this file cannot reflect the latest version of the snap package correctly if there are patches added the in the latest release. For example, if the VERSION is set to 1.7.0, and there are some patches added after the release, the snap should be versioned with 1.7.0.xxxx.

This can be achieve using the override-pull in snapcraft.yaml: (note it requires the repo to fetch the git tags)

...
    override-pull: |
      craftctl default
      TAG=$(git describe --tags --abbrev=10)
      craftctl set version="${TAG#v}"
...

Related to #346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant