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

goreleaser: init snap, linux shell completions #1744

Merged
merged 9 commits into from
Apr 24, 2024
Merged

goreleaser: init snap, linux shell completions #1744

merged 9 commits into from
Apr 24, 2024

Conversation

jzelinskie
Copy link
Member

@jzelinskie jzelinskie commented Feb 13, 2024

Shoutouts to @jnsgruk and @caarlos0 for guidance around snaps and packaging completion for goreleaser!

@jzelinskie jzelinskie added area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) platform/linux Affects Linux builds labels Feb 13, 2024
@jnsgruk
Copy link

jnsgruk commented Feb 29, 2024

Hey Jimmy, do you need any assistance moving this forward? There's some simple CI work we could do to start pushing this out to edge on merges to main if that's something you'd like to experiment with?

@jzelinskie jzelinskie changed the title goreleaser: init snap goreleaser: init snap, linux shell completions Feb 29, 2024
@jzelinskie
Copy link
Member Author

Thanks for checking in @jnsgruk.

I've got snaps building.

I took a bit longer for this PR because I also added shell completions to our Linux packages; is there a standard way to add this for snaps? Otherwise I'm ready to take your lead on how to get things pushed to the snap store.

@jnsgruk
Copy link

jnsgruk commented Feb 29, 2024

@jzelinskie
Copy link
Member Author

It looks like my last commit does the trick, but it doesn't follow the snap.spicedb naming convention.

What's next to get this plugged into the snap store channels?
We've got another goreleaser config and workflow for pushing builds of main that'd be trivial to update with the snaps.

@jnsgruk
Copy link

jnsgruk commented Mar 3, 2024

Next step would be to register your snap name. I'd recommend using a company account for signing up to snapcraft.io (like [email protected] or similar) so we can get it verified later.

Once you've signed up and registered, you'll need to export a token and set it in Github Actions secret as the variable SNAPCRAFT_STORE_CREDENTIALS.

Finally - set up a job that publishes the *.snap files [like this] (https://github.com/parca-dev/parca/blob/c14c86b662c8c7cb12c633e6e0c668af20cc4dbb/.github/workflows/release.yml#L187-L206). The other option might just be to set publish: true in your snapcrafts section of goreleaser, but I've got less experience with how to auth that etc.

@jnsgruk
Copy link

jnsgruk commented Mar 3, 2024

Looking at the goreleaser docs, you may need something like so in your snapcrafts section:

extra_files:
      - source: completions/spicedb.bash
        destination: completions/spicedb.snap
        mode: 0755

Which will actually stage the completer, with the bonus that you can follow the snapcraft naming convention?

@jzelinskie
Copy link
Member Author

jzelinskie commented Mar 14, 2024

I'm not sure why, but extra_files appears to do nothing and I can only get completer to include the file when it ends with .bash and not .snap. @caarlos0 am I doing something wrong? I'm testing by running unsquashfs on the snap and inspecting the contents.

@jzelinskie
Copy link
Member Author

Sorry about this -- I was traveling for KubeCon and on vacation. Getting back to it soon.

@jzelinskie
Copy link
Member Author

@jnsgruk is the naming convention there a dealbreaker? I'd like to get this moving along and maybe we can go back and address that after we kick the tires with some of the publishing pipeline.

@jnsgruk
Copy link

jnsgruk commented Apr 23, 2024

Hey @jzelinskie! I did a bit of digging this morning, and I think the naming is fine.

I also came across this guide for debugging it if we run into problems. I note that in the example there they use:

name: foo
version: v1
apps:
  bar:
    command: bar
    completer: bar-completer.sh # this is the one!

So I think you're good!

nightly.goreleaser.yml => .goreleaser.nightly.yml
This change is intended to make it more difficult
to forget to update nightly config when making any
changes to the primary goreleaser config.
@jzelinskie jzelinskie requested a review from a team as a code owner April 24, 2024 22:14
Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@jzelinskie jzelinskie added this pull request to the merge queue Apr 24, 2024
Merged via the queue into main with commit 9da37ed Apr 24, 2024
22 checks passed
@jzelinskie jzelinskie deleted the snap branch April 24, 2024 22:51
@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) platform/linux Affects Linux builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants