Sidekick icon indicating copy to clipboard operation
Sidekick copied to clipboard

FR: Add to homebrew

Open Xytronix opened this issue 9 months ago • 13 comments

I would love if this app makes it to homebrew/cask

https://docs.brew.sh/Acceptable-Casks#rejected-casks https://github.com/Homebrew/homebrew-cask

Xytronix avatar Mar 13 '25 14:03 Xytronix

Please let me know if I can contribute to this project by solving this issue with PR

iLuJack avatar Mar 14 '25 01:03 iLuJack

@iLuJack

I've never added a project to Homebrew Casks before, so I'd be happy to hand this to you if you have experience.

Slight question: how would an update be pushed to Homebrew? Could this be done by a Github Action?

johnbean393 avatar Mar 14 '25 01:03 johnbean393

@johnbean393 Sorry for the late response,

For the initial cask, I will create a pull request to homebrew/cask for SideKick.

The following image is the template/example to add a project to Homebrew Casks from Cask Cookbook Image

Before submitting the PR, I’ll share my progress with you.

Regarding SideKick updates: Yes, they can be automated using GitHub Actions! Once the initial cask is accepted, we can set up an action in the SideKick repo, but we can work out the details later.

iLuJack avatar Mar 15 '25 04:03 iLuJack

@iLuJack

Sounds good; let's do it!

Note that this project is spelt "Sidekick" with only "S" capitalized, so let's get that right on Homebrew casks 👍

Again, thanks for volunteering.

johnbean393 avatar Mar 15 '25 04:03 johnbean393

@johnbean393 Unfortunately, there is already an app called Sidekick in Homebrew Cask. Do you have any thoughts on alternative names? Image

iLuJack avatar Mar 15 '25 09:03 iLuJack

@iLuJack

What do you think about sidekick-app? This would make sense if there is a sidekick-cli Homebrew formulae at some point.

johnbean393 avatar Mar 15 '25 10:03 johnbean393

@johnbean393 I think it's perfect! That makes a lot of sense

iLuJack avatar Mar 15 '25 10:03 iLuJack

@johnbean393 The cask setting is as follows and has been tested, working as expected. However, I might need some of your help:

  • Currently, Homebrew prioritizes stable releases over pre-releases. Would you be able to designate one of your releases as the stable release?
  • The current .dmg filename includes a date, which may not be ideal for Homebrew’s auto-update process, as it changes with each release. A more standard format for GitHub would be Sidekick-beta-#{version}.dmg. Would this be a better approach?
# this is not the final-version, I add some comments & annotations to make it more readable & understandable
# typed: strict
# frozen_string_literal: true

# brew install --cask sidekick-app
cask "sidekick-app" do
  version "0.0.22"
  sha256 "48a1703da99e28c3c048122c142a586450e6dc33c20893ddea6e92e34745e43d"
  # sha256 is checksum for the dmg file

  url "https://github.com/johnbean393/Sidekick/releases/download/#{version}/Sidekick-beta.#{version}.2025-03-13.dmg",
      verified: "github.com/johnbean393/Sidekick/"
  # url is the download link for the dmg file
  # verified is to ensure the download is from the correct source

  # brew info --cask sidekick-app => show name & desc
  name "Sidekick"
  desc "Chat with a local LLM that accesses and retrieves info from your computer"
  
  homepage "https://johnbean393.github.io/Sidekick/"
  # homepage is the homepage of the app

  # brew livecheck sidekick-app => check whether the latest version is available
  livecheck do
    url :url
    strategy :github_latest
    regex(%r{/download/(\d+(?:\.\d+)+)/Sidekick-beta})
  end

  auto_updates true
  # auto_updates is to signal the app can be auto-updated

  depends_on macos: ">= :sonoma"
  depends_on arch: :arm64
  # requires a mac with Apple Silicon

  app "Sidekick-beta.app"
  # must be the same as the application name 

  # Complete uninstall (removes all app data)
  # brew uninstall --zap --dry-run --cask sidekick-app
  # brew uninstall --zap --cask sidekick-app
  zap trash: [
    "~/Library/Application Support/com.pattonium.Sidekick",
    "~/Library/Application Support/Sidekick",
    "~/Library/Caches/com.apple.nsurlsessiond/Downloads/com.pattonium.Sidekick",
    "~/Library/Caches/com.pattonium.Sidekick",
    "~/Library/HTTPStorages/com.pattonium.Sidekick",
    "~/Library/Preferences/com.pattonium.Sidekick.plist",
    "~/Library/Saved Application State/com.pattonium.Sidekick.savedState",
  ]
end

For Homebrew auto-updates with each release, I am currently testing this in my forked repo. Should I create a separate issue for this?

iLuJack avatar Mar 16 '25 07:03 iLuJack

@iLuJack

Thanks for the amazing work; the comments and annotations are really helpful!

  1. We're working toward a stable release for Sidekick. There's one more major bug that I need to solve (#14), and a few features to add. I can see Sidekick arriving at a stable release in the next month or so.

In terms of semantic versioning, I think the stable release would be a 1.x.x. The app (including the .dmg installer) would also be renamed to Sidekick.app instead of the current Sidekick-beta.app. This might have to be changed on Homebrew.

  1. You make a good point about the date in the .dmg archive's filename; I've gotten rid of this starting with the current release (0.0.23).

  2. Let's create a new issue for the auto-updates 👍

Slight issue, I see that the requirements were set to macOS: ">= :monterey", but Sidekick requires macOS Sonoma or above.

johnbean393 avatar Mar 16 '25 08:03 johnbean393

@johnbean393

  1. Since the stable release is expected to arrive next month, should I create a beta version for Homebrew with slightly different requirements and settings, or would it be better to wait for the stable release?

  2. Thanks for your bug report! The requirement has now been fixed to depends_on macos: ">= :sonoma".

iLuJack avatar Mar 17 '25 04:03 iLuJack

@iLuJack

Let's wait for the stable release, since it's not too far off. 👍

johnbean393 avatar Mar 17 '25 04:03 johnbean393

Currently, I'm busy with school and side projects, so I might not notice if you launch a stable release and forget to submit it to Homebrew. Feel free to remind me or have someone else handle it!

iLuJack avatar Mar 21 '25 05:03 iLuJack

@iLuJack

Of course! I'll hit you up here and on Discord.

johnbean393 avatar Mar 21 '25 09:03 johnbean393