Skip to content

Add macOS pkg installer #7554

Description

@paulober

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.

Activity

  1. added
    discussFeature changes that require discussion primarily among the GitHub CLI team
    and removed on Jun 8, 2023
  2. paulober commented on Jun 8, 2023

    @paulober
    ContributorAuthor

    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)

  3. williammartin commented on Jun 8, 2023

    @williammartin
    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!

  4. paulober commented on Jun 8, 2023

    @paulober
    ContributorAuthor

    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.

  5. paulober commented on Jun 8, 2023

    @paulober
    ContributorAuthor

    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)

  6. vilmibm commented on Jun 12, 2023

    @vilmibm
    Contributor

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

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

  7. paulober commented on Jun 12, 2023

    @paulober
    ContributorAuthor

    @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)

  8. paulober commented on Jun 17, 2023

    @paulober
    ContributorAuthor

    @williammartin Any updates on this?

  9. williammartin commented on Jun 22, 2023

    @williammartin
    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!

  10. annie-maria commented on Jul 7, 2023

    @annie-maria

    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.

  11. paulober commented on Jul 7, 2023

    @paulober
    ContributorAuthor

    @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

  12. removed
    discussFeature changes that require discussion primarily among the GitHub CLI team
    on Oct 31, 2023
  13. 3 remaining items

  14. williammartin commented on May 20, 2024

    @williammartin
    Member

    Some more evidence that this could be useful #9100

  15. added a commit that references this issue on May 24, 2024
  16. matix16690 commented on Jan 25, 2025

    @matix16690
  17. KjongSounnd commented on Mar 21, 2025

    @KjongSounnd
  18. deleted a comment from Hitras2 on Apr 9, 2025
  19. rugo2001xd commented on May 28, 2025

    @rugo2001xd
  20. rugo2001xd commented on May 28, 2025

    @rugo2001xd
  21. cmb82 commented on Jul 1, 2025

    @cmb82
  22. Crisco82-ai commented on Jul 5, 2025

    @Crisco82-ai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussFeature changes that require discussion primarily among the GitHub CLI teamenhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions