8000 Add snapcraft.yaml by iamjameswalters · Pull Request #56 · alexhallam/tv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add snapcraft.yaml #56

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

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Add snapcraft.yaml #56

merged 1 commit into from
Sep 29, 2021

Conversation

iamjameswalters
Copy link
Contributor

Adds a snapcraft.yaml which can be used to build tidy-viewer as a snap and publish it to the Snap Store.

I've built it successfully on my machine. 🙂

@iamjameswalters iamjameswalters mentioned this pull request Sep 29, 2021
@alexhallam
Copy link
Owner

This is really cool. I was looking through the yaml and did not see a key for a version number. Do snaps have that option?

Copy link
Owner
@alexhallam alexhallam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know much about snapcraft so you will have to keep me honest. When I looked up the docs for version number I saw that it was a mandatory key. I am assuming that means that having it in the yaml is a necessary condition for an upload to snapcraft. Could you double check that all other mandatory keys are present in this file?

As a reference I was looking here https://snapcraft.io/docs/snapcraft-yaml-reference

description: |
Tidy Viewer (tv) is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.
base: core20

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add version: 0.0.13 and any other mandatory keys. https://snapcraft.io/docs/snapcraft-yaml-reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you're right: all snaps must be given a version string at build time. You can do that with the version key, or in this case, I sprinkled a bit of magic 🎩 in for that. adopt-info: tidy-viewer tells snapcraft to look in the tidy-viewer part for additional metadata. There, I used the override-pull key to add a step to the build that sets the snap version to the output of git describe --tags --abbrev=0.

This would let you automate things a bit: once you've published the snap in the store, you can point it at the Github repo, and it can automatically build and publish new versions to an edge channel. You would then just promote those builds to a stable channel whenever they were ready/you felt like it/you remembered. 🙂

However, it's no big deal to use a version key, you'd just need to manually push the version number with every new build. Let me know which approach you'd like, and if needed I can edit this PR accordingly.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for teaching me how it works.

@alexhallam alexhallam merged commit 83340ce into alexhallam:main Sep 29, 2021
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

Successfully merging this pull request may close these issues.

2 participants
0