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 macOS pkg installer #7554

Open
paulober opened this issue Jun 8, 2023 · 10 comments · May be fixed by #7555
Open

Add macOS pkg installer #7554

paulober opened this issue Jun 8, 2023 · 10 comments · May be fixed by #7555
Labels
discuss Feature changes that require discussion primarily among the GitHub CLI team enhancement a request to improve CLI

Comments

@paulober
Copy link

paulober commented Jun 8, 2023

Describe the feature or problem you’d like to solve

Also build a pkg installer for macOS like for example Python and Go have so developers on macOS don't have to install the zip manually.

Proposed solution

A more simple and faster installation process for macOS developers with the addition of zsh autocompletion support which was linux exclusive before.

Additional context

I'll assign my self to develop this so you don't have to as I rely want to see this feature.

@paulober paulober added the enhancement a request to improve CLI label Jun 8, 2023
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Jun 8, 2023
@paulober paulober linked a pull request Jun 8, 2023 that will close this issue
@williammartin williammartin added discuss Feature changes that require discussion primarily among the GitHub CLI team and removed needs-triage needs to be reviewed labels Jun 8, 2023
@paulober
Copy link
Author

paulober commented Jun 8, 2023

In the PR I also implemented an "build & sign" option for production build of the pkg installer which would also sign the installer.
I could not use the already existing sign script because to sign a pkg installer you need productsign or productbuild --sign and a different developer ID for the sign parameter (if I remember correctly)

@williammartin
Copy link
Member

Hi @paulober, thanks for opening this enhancement request and doing the work on the associated PR. As per our Contributing Policy we don't accept PRs for work we haven't discussed.

I'm going to mark this with a discuss label so we can talk about it as a team, and if we're happy with the idea we'll review your approach. Again, thank you for spending the time on the PR.

In the meantime, just so I understand, your current approach for installing on MacOS is to download the release artifact from GitHub, to unzip and use that for installation, correct? And this approach will use the MacOS installation process to automate that, and also set up autocompletions for zsh? (FWIW, if you install via homebrew you get this, but I understand not everyone wants to install that way).

Cheers!

@paulober
Copy link
Author

paulober commented Jun 8, 2023

Hi @williammartin,

I'm glad that the approach of creating a macOS installer package will be discussed. Currently, I manually install the macOS arm64 artifact by downloading and copying the contents to the desired location.

By creating a macOS installer package (.pkg file), we can bundle the binary, man pages, and zsh autocompletion script in a structured and standardized manner. This package serves as a Mac equivalent of a deb package on Linux, simplifying the installation process.

An advantage of this approach is its compatibility with both Intel and Apple Silicon Macs. The package contains a macOS universal binary, allowing seamless installation on both architectures without requiring user intervention. I decided to use the Universal Binary feature as this also simplifies the installation package structure and reduces the resulting artifacts count.

If you have any further questions, please let me know.

@paulober
Copy link
Author

paulober commented Jun 8, 2023

Here is the installer for the current v2.30.0 release as a showcase:
gh_2.30.0_macOS_universal.pkg.zip(it's only compressed again to upload it here)

@vilmibm
Copy link
Contributor

vilmibm commented Jun 12, 2023

I'm curious why homebrew falls short for installing the GitHub CLI?

Overall I'm worried about maintaining a pkg installer moving forward.

@paulober
Copy link
Author

paulober commented Jun 12, 2023

@vilmibm

  1. Homebrew would be the only option for macOS guys if they won't manually install the files and on Windows and Linux are installers independent from repositories or maintainers available for direct download on GitHub
  2. On some systems in companies you can request a certain application to be installed on your dev box. Pkg can be easily distributed and updated thought deployment systems but homebrew would be special and you would have another different party on your system
  3. Homebrew messes with the Xcode command line tools installation: It often overrides the command line tools provided by Xcode or changes something. Also it spreads around on the system and from a security kind of perspective as a third party system with permission to install stuff...

Also, the pkg installer would be also build by the CI and it really only copies a file structure you put into it on the target machine. So for example payload/usr/local/bin/gh would make the installer moving gh into /usr/local/bin. Just change the path and it moves it somewhere else.
But I can understand the concern of having to care about an additional distribution package and I can just say, I think there are many macOS devs which would appreciate the option to install gh cli with an pkg installer...

(sry for my English, I'm not a native speaker)

@paulober
Copy link
Author

@williammartin Any updates on this?

@williammartin
Copy link
Member

@paulober sorry for the delay and thank you for the additional information. We discussed it and we think it's a reasonable enhancement but from our side we need to do a little more investigation into the maintenance burden to support this before committing. Note that I'm not saying it requires too much maintenance, just that no one on the team has experience with MacOS pkg installers and we don't want to commit to something we don't have a good understanding of.

I'll update you on this issue once we've had time to do the necessary investigation. Thanks!

@annie-maria
Copy link

Homebrew has messed up my system in the past and I must avoid using it for reasons. It would be nice if the downloaded zip at least gave some directions as to where I'm supposed to place the downloaded folder: gh_2.31.0_macOS_amd64

Apologies if it's a dumb question. Thank you.

@paulober
Copy link
Author

paulober commented Jul 7, 2023

@annie-maria Exactly why we need a pkg installer. I build for my self a pkg for the current release (it's also signed):
gh_v2.31.0_macOS_universal.pkg.zip
It does only auto copy the files from the zip + zsh completions into /usr/local/bin /usr/local/share

@williammartin williammartin added discuss Feature changes that require discussion primarily among the GitHub CLI team and removed discuss Feature changes that require discussion primarily among the GitHub CLI team enhancement a request to improve CLI labels Oct 31, 2023
@andyfeller andyfeller added the enhancement a request to improve CLI label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature changes that require discussion primarily among the GitHub CLI team enhancement a request to improve CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants