thebarbican19 / BatteryBoi

The battery app your Mac's been dreaming about behind your back.
https://batteryboi.ovatar.io/
GNU General Public License v3.0
846 stars 20 forks source link

[Request] Version numbers simplification for brew compatibility #25

Closed kannicht closed 12 months ago

kannicht commented 1 year ago

Hi,

I'd like to add BatteryBoi to Homebrew as soon as the repo is 30 days old. For that and for easier maintenance of that I'd recommend removing the #xx part of the release names/version numbers.

thebarbican19 commented 1 year ago

I would love homebrew support. As for the build number, this is only here as I was having difficulties with Sparkle.

thebarbican19 commented 1 year ago

If you have any experience with Sparkle, I would love help here @kannicht

kannicht commented 1 year ago

I might dive into Sparkle in the upcoming days to see wether and how I can be of service 🫡

As for the brew support: I'm already done so far with that and just have to wait two or three days until it can be submitted due to Brew's regulations. Just for documentation purposes I'll publish it here :)

cask "batteryboi" do
  version "2.1.0"
  sha256 :no_check

  url "https://github.com/thebarbican19/BatteryBoi/releases/download/Version2.1.0%2316/BatteryBoi-V2.1.0.dmg", verified: "github.com/"
  name "batteryboi"
  desc "Better battery indicator for the menu bar"
  homepage "https://batteryboi.ovatar.io/"

  depends_on macos: ">= :big_sur"

  app "BatteryBoi.app"
end
thebarbican19 commented 1 year ago

Wow wow wow @kannicht, you are on a roll! How can I repay you?

kannicht commented 1 year ago

In terms of Sparkle: I'm relatively new to Swift so I might not promise anything :D

A usual joke from my side: I bill 36,80€ plus taxes per minute 😂

kannicht commented 1 year ago

That is the current audit message which has to go away for brew approval. :)

Bildschirmfoto 2023-09-05 um 21 56 56
kannicht commented 1 year ago

Okay, PR for Homebrew is out. They have one request over there: if you @thebarbican19 do minor updates: make sure to reflect this in the file name you put on as an asset on GitHub :)

So basically the actual .dmg needs to have the proper version number :)

thebarbican19 commented 1 year ago

Ok great, anything you need. Hopefully, we can get this version number thing resolved together @kannicht

kannicht commented 1 year ago

Yeah, so basically for an easy integration in the future (and therefore easy updates on Brew) just make sure to use the the actual version number in the dmg that you pass on with sparkle, the x.x.x part is totally fine :)

image

Top Version number needs to match the .dmg. Here it differs ;)

As far as I understood Sparkle you pass on the final dmg to the service and that creates the releases, correct?

thebarbican19 commented 1 year ago

@kannicht no with Sparkle you have an appcast.xml (https://api.ovatar.io/version?id=com.ovatar.batteryapp), this is the wrapper I made.

kannicht commented 1 year ago

Soooo :)

some more versions in, the devs of homebrew are complaining about the version numbers not matching between the .dmg and the sparkle version (and not even the release headline here on GitHub). Anything on your side you can do about it? :)

jonathanlaniado commented 1 year ago

+1, eagerly waiting for Homebrew support.

thebarbican19 commented 1 year ago

I am still waiting on help on the Sparkle implementation here, or enough donations that I can hire someone to fix it. I am just one person here and can't do it all.

Mrered commented 1 year ago

I wait to realize the support of Homebrew. Looking forward to it. Thank you @thebarbican19 very much.

kannicht commented 12 months ago

As of some minutes ago, BatteryBoi is merged into Homebrew and should be available publicly soon. :)

https://github.com/Homebrew/homebrew-cask/pull/154604

jonathanlaniado commented 12 months ago

Awesome job, @kannicht. How long does it usually take? Not seeing it yet.

kannicht commented 12 months ago

I literally have no idea. Just give it some time, even Homebrew needs some rest and sleep 😃

thebarbican19 commented 12 months ago

Wow, thanks so much @kannicht

kannicht commented 12 months ago

For those not seeing BatteryBoi as of now run ´brew update --force´. It is there ;)

thebarbican19 commented 12 months ago

Thanks @kannicht, I will update the docs tomorrow with this and of course credit for you and your hard work.

kannicht commented 12 months ago

No worries @thebarbican19 , it wasn't as hard as the work you put into the app itself.

I'd just like to recap everything for you as I think we talked past each other ;)

The problem has never been Sparkle, the implementation on this side was totally fine and the devs over at Brew showed (even though not actually pointing this out) that it has been right all the time.

The main issue was the .dmg here on Github as this had different version number (e.g. Sparkle showing 2.3.x but the actual downloadable .dmg here showed 2.4.x) which from what I can tell digging slightly into the Sparke documentation is something that is created manually and even uploaded to Github manually(?). I just like to ask you to make sure in the future, that theses numbers add up :)

This is the final Cask for BatteryBoi: as you see for it to work after an update the versions need to add up :)

cask "batteryboi" do
  version "2.4.1,27"
  sha256 "9406640e508ead5e66c28a3121d1b96e22576acf49aba849c11fdb5ba019ba23"

  url "https://github.com/thebarbican19/BatteryBoi/releases/download/Version#{version.csv.first}%23#{version.csv.second}/BatteryBoi-V#{version.csv.first}.dmg",
      verified: "github.com/thebarbican19/BatteryBoi/"
  name "BatteryBoi"
  desc "Battery indicator for the menu bar"
  homepage "https://batteryboi.ovatar.io/"

  livecheck do
    url "https://api.ovatar.io/version?id=com.ovatar.batteryapp"
    strategy :sparkle
  end

  depends_on macos: ">= :big_sur"

  app "BatteryBoi.app"

  zap trash: [
    "~/Library/Application Support/BatteryBoi",
    "~/Library/Caches/com.ovatar.batteryapp",
    "~/Library/HTTPStorages/com.ovatar.batteryapp",
    "~/Library/Preferences/com.ovatar.batteryapp.plist",
    "~/Library/Saved Application State/com.ovatar.batteryapp.savedState",
  ]
end

If you have any questions, just tag me here :)

thebarbican19 commented 12 months ago

Thanks for the clarification on all of this, I will make sure to check and double-check before submitting a new release. I have now added this to the README, so it's official! Thanks again this is a really nice addition.