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

Add support for Snap #1231

Closed
wants to merge 0 commits into from
Closed

Add support for Snap #1231

wants to merge 0 commits into from

Conversation

akshaybabloo
Copy link

@akshaybabloo akshaybabloo commented Jun 14, 2022

This partially fixes #429 by adding support for Snap.

Now you will have to create a Ubuntu account and then install Snapcraft from your terminal

  1. sudo snap install snapcraft --classic => this should also install multipass or else it will ask for you to install
  2. snapcraft login
  3. snapcraft export-login file.txt - you might have to enter your username and password again
  4. Create a GitHub secrets with SNAPCRAFT_LOGIN as your key and the values from the file.

You might probably want to try this on your local system. I think this should do it.

@akshaybabloo akshaybabloo marked this pull request as draft June 14, 2022 02:08
@akshaybabloo
Copy link
Author

@casey can I add a new release CI - .github/workflows/snap-release.yaml to upload the builds?

@casey
Copy link
Owner

casey commented Jun 14, 2022

@akshaybabloo Yup definitely. You could also add it to the existing release YAML file.

Is there a good way to automatically update the version numbers? It would be nice if I didn't have to update the yaml files when cutting a new release.

@akshaybabloo
Copy link
Author

Is there a good way to automatically update the version numbers? It would be nice if I didn't have to update the yaml files when cutting a new release.

Working on it. I will add a shell script to update that.

@casey
Copy link
Owner

casey commented Jun 14, 2022

Working on it. I will add a shell script to update that.

This can be left for another diff, just to keep things simple.

Also, does the snapcraft.yaml file need to be in a snap subdirectory? If not, then let's just put it in the root, since it's only one file.

@akshaybabloo akshaybabloo marked this pull request as ready for review June 15, 2022 03:11
@akshaybabloo
Copy link
Author

@casey I think its ready. I tried it locally and it runs fine. I have updated the description, you will hve to create the account and upload it 🤞🏾

@akshaybabloo akshaybabloo changed the title WIP: add support for Snap Add support for Snap Jun 15, 2022
@casey
Copy link
Owner

casey commented Jun 20, 2022

@casey I think its ready. I tried it locally and it runs fine. I have updated the description, you will hve to create the account and upload it 🤞🏾

Nice! Do you know if I can do this from a mac? I don't have an Ubuntu box handy.

@akshaybabloo
Copy link
Author

@casey I think its ready. I tried it locally and it runs fine. I have updated the description, you will hve to create the account and upload it 🤞🏾

Nice! Do you know if I can do this from a mac? I don't have an Ubuntu box handy.

I think you can. https://snapcraft.io/docs/installing-snapcraft. My mac is way too old to handle this 😄

@akshaybabloo
Copy link
Author

You will need Docker and Multipass though

@casey
Copy link
Owner

casey commented Jun 20, 2022

Can releasing on snap be done on github actions? I don't think I can commit to a manual release step. I make frequent releases, and I've found that I just do a bad job managing packages for OSs that I don't use.

@akshaybabloo
Copy link
Author

Can releasing on snap be done on github actions? I don't think I can commit to a manual release step. I make frequent releases, and I've found that I just do a bad job managing packages for OSs that I don't use.

The snap-release.yaml workflow should do that for you. All you must do is change the version number in snapcraft.yaml when releasing a new tag. I can create a python script to automat this if that's OK with you (that is to change the version number of new tag release)?

But for now you will have to create a secret toke for this to work

@casey
Copy link
Owner

casey commented Jun 20, 2022

I just tried to publish, and it looks like classic confinement now requires manual review, so that will take a while. Also, did you happen to register the just snap name? I tried to register it, but it looks like it's taken by a private snap.

@casey
Copy link
Owner

casey commented Jun 20, 2022

Also, here's a snapcraft.yaml file with some more metadata:

base: core20
confinement: classic
contact: casey@rodarmor.com
description: Just is a handy way to save and run project-specific commands.
grade: stable
icon: icon.png
issues: https://github.com/casey/just/issues
license: CC0-1.0
name: just
source-code: https://github.com/casey/just
summary: Just a command runner
version: '1.2.0'
website: https://just.systems

apps:
  just:
    command: bin/just

parts:
  just:
    source: https://github.com/casey/just
    source-type: git
    source-tag: '1.2.0'
    source-depth: 1
    plugin: rust

@akshaybabloo
Copy link
Author

I just tried to publish, and it looks like classic confinement now requires manual review, so that will take a while. Also, did you happen to register the just snap name? I tried to register it, but it looks like it's taken by a private snap.

I didn't actually. Must be someone else. I hope there is another name we can have it just to publish it?

@akshaybabloo
Copy link
Author

Also, here's a snapcraft.yaml file with some more metadata:

base: core20
confinement: classic
contact: casey@rodarmor.com
description: Just is a handy way to save and run project-specific commands.
grade: stable
icon: icon.png
issues: https://github.com/casey/just/issues
license: CC0-1.0
name: just
source-code: https://github.com/casey/just
summary: Just a command runner
version: '1.2.0'
website: https://just.systems

apps:
  just:
    command: bin/just

parts:
  just:
    source: https://github.com/casey/just
    source-type: git
    source-tag: '1.2.0'
    source-depth: 1
    plugin: rust

Updated

@casey
Copy link
Owner

casey commented Jun 20, 2022

I just submitted a request for the name, and it was approved. I think maybe they have some anti-squatting check for short names, or english words, or something.

@casey
Copy link
Owner

casey commented Jun 20, 2022

Can you enable pushes from reviewers for this PR? I'm updating the YAML file and building locally, and it would be convenient to be able to push the changes that I make to the PR branch.

@akshaybabloo
Copy link
Author

Can you enable pushes from reviewers for this PR? I'm updating the YAML file and building locally, and it would be convenient to be able to push the changes that I make to the PR branch.

I think it's already enabled.

I just submitted a request for the name, and it was approved. I think maybe they have some anti-squatting check for short names, or english words, or something.

Nice!

@casey
Copy link
Owner

casey commented Jun 21, 2022

Are you sure? I tried to push, but it was rejected. You might have branch protection enabled on master.

@akshaybabloo
Copy link
Author

All looks good from my side (screenshots below).

image

image

@casey casey closed this Jun 21, 2022
@casey
Copy link
Owner

casey commented Jun 21, 2022

Something is completely hosed with git. I'm not sure if it's my local branch, something with how github is configured, or what. I was able to push the wrong commit to your branch (i force pushed master, which auto-closed the PR) but can't push the right branch. I'll push to a new branch and open a new PR.

@akshaybabloo
Copy link
Author

Okay. Yep Git does that time-to-time specially submodules

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.

Package just for Debian and get it accepted into the main package repository: $200 bounty
2 participants