altsem / gitu

A TUI Git client inspired by Magit
MIT License
1.7k stars 88 forks source link

ci: add cachix workflow #85

Closed musjj closed 4 months ago

musjj commented 4 months ago

This adds a binary cache so that Nix users don't have to build gitu on their machine.

For this to work, the repo owner needs to register their project on Cachix and add the secret token to the GitHub repo. Instructions can be found from the official tutorial here:

1. Creating your first binary cache

It's recommended to have different binary caches per team, depending who will have write/read access to it.

Fill out the form on the create binary cache page.

On your freshly created binary cache, follow the Push binaries tab instructions.

2. Setting up secrets

On your GitHub repository or organization (for use across all repositories):

  1. Click on Settings.
  2. Click on Secrets.
  3. Add your previously generated secrets (CACHIX_SIGNING_KEY and/or CACHIX_AUTH_TOKEN).

For this PR, I'm using CACHIX_AUTH_TOKEN.

altsem commented 4 months ago

:+1: lets try it out!

musjj commented 4 months ago

It looks like it's not getting pushed:

Warning: No push credentials found. Ignoring the 'useDaemon' option. Pushing is disabled because neither signingKey nor authToken are set (or are empty?) in your YAML file.

Did you add the CACHIX_AUTH_TOKEN secret to the GitHub repository?

Spoke too soon, didn't see the latest commit :smiley:. It should be working now, but I'll test it out.

altsem commented 4 months ago

I saw that it just successfully uploaded something!

musjj commented 4 months ago

Yep, tested it on my end and it works :tada:

For any Nix users reading, just add the following to your nix.settings:

substituters = [ "https://gitu.cachix.org" ];
trusted-public-keys =
  [ "gitu.cachix.org-1:iUIaNys1l3W1LF/M8OXzaTl7N/OinGOlzdUJUSc+5eY=" ];

And you shouldn't need to ever build gitu again!

altsem commented 4 months ago

@musjj perhaps this should be in the readme. It's becoming a bit long, but that's fine. At some point I'd like to split it up into several pages.