Hi, I try to build my Python CLI app https://snapcraft.io/zshgpt https://github.com/AndersSteenNilsen/zshgpt
First I tried
name: zshgpt
summary: Power up your zsh with gpt
description: Power up your zsh with gpt.
grade: stable
version: git
confinement: devmode
base: core20
license: MIT
architectures:
- build-on: [arm64, armhf, amd64]
apps:
zshgpt:
command: bin/zshgpt
plugs: [home, network, network-bind, removable-media]
parts:
zshgpt:
plugin: python
python-packages: [zshgpt]
The result I got was always a version like 0+git.<hash>
Even though I have tagged the repo
git describe --tag
v1.0.1
I debugged and changed snapcraft.yaml
to
name: zshgpt
summary: Power up your zsh with gpt
description: Power up your zsh with gpt.
grade: stable
version: git
confinement: devmode
base: core20
license: MIT
adopt-info: zshgpt
architectures:
- build-on: [arm64, armhf, amd64]
apps:
zshgpt:
command: bin/zshgpt
plugs: [home, network, network-bind, removable-media]
parts:
zshgpt:
plugin: python
python-packages: [zshgpt]
override-pull: |
snapcraftctl pull
git -C /root/project describe --tags #For debugging
snapcraftctl set-version $(git -C /root/project describe --tags)
(For reference I also tried snapcraftctl set-version $(git describe --tags)
But got something like This directory nor any parent directory is a git repo
)
I got correct result when I ran snapcraft
locally, but when I pushed the changes to my repo I got this message:
+ git -C /root/project describe --tags
fatal: cannot change to '/root/project': No such file or directory
Would be happy to get some feedback in order to resolve this.
PS: I also found the information around version:git
lacking in the tutorial/reference