CLI: Release distribution
This epic is concerned with distributing new [gitlab-org/cli](https://gitlab.com/gitlab-org/cli) (`glab`) releases on Windows, MacOS, and Linux.
This epic is a follow-up from https://gitlab.com/gitlab-org/cli/-/issues/1014.
When we migrated the CI for making CLI releases, we realized that the `glab` CLI tool had been distributed through many channels.
## Existing distribution channels
### Overview
| Distribution channel | Up to date | Maintained by `@profclem` | Next step (IMO)<br>✅ - adopt<br>⚠️ - deprecate and replace<br>❌ - no action (just contact maintainer) |
|---------------------------|------------|---------------------------|------------------------------------------------------------------------------------------------------|
| Homebrew | ✅ | ✅ | ✅ |
| Macports | ✅ | ❌ | ❌ |
| Arch Linux | ✅ | ❌ | ❌ |
| Snap | ✅ | ✅ | ✅ |
| Kiss | ❌ | ❌ | ❌ |
| Alpine | ✅ | ❌ | ❌ |
| NixOS | ✅ | ❌ | ❌ |
| Docker registry | ✅ | ✅ | ⚠️ |
| GitHub container registry | ✅ | ✅ | ⚠️ |
| Winget | ✅ | ✅* | ✅ |
| Scoop | ✅ | ✅* | ✅ |
`*` initial PR was created by `@profclem`, but now the package repository updates automatically from `github.com/profclem/glab`
### MacOS
- [Homebrew](https://gitlab.com/gitlab-org/cli#homebrew) (up to date)
- In the `homebrew-core` formula: https://github.com/Homebrew/homebrew-core/blame/master/Formula/glab.rb
- Example version upgrade:
- commit: https://github.com/Homebrew/homebrew-core/commit/06e76c722abb361f829d642e6b42ec291713f3f4
- PR: https://github.com/Homebrew/homebrew-core/pull/92828
- The GitHub project used https://github.com/mislav/bump-homebrew-formula-action and it needed `@profclem`'s token
- Docs:
- Adding formula: https://docs.brew.sh/Adding-Software-to-Homebrew
- Updating formula: https://docs.brew.sh/Updating-Software-in-Homebrew
- We might consider creating our own tap rather than using the main repo. That way, we would have better control over release because in the main repo, a Homebrew member needs to approve the version upgrade PR
- We probably won't use [The Homberew GitHub Action](https://github.com/mislav/bump-homebrew-formula-action), but the `goreleaser` [supports Homebrew releases](https://goreleaser.com/customization/homebrew/) out of the box
- Maintained by [Clement Sam](https://github.com/profclems)
- [MacPorts](https://gitlab.com/gitlab-org/cli#macports) (up to date)
- `glab` package https://ports.macports.org/port/glab/details/
- Config file https://github.com/macports/macports-ports/blob/master/devel/glab/Portfile
- Maintained by [Haren S](https://github.com/harens)
### Linux
- [Arch linux](https://gitlab.com/gitlab-org/cli#arch-linux) (up to date)
- `community/glab` package in [Arch Linux - glab 1.22.0-2 (x86_64)](https://archlinux.org/packages/community/x86_64/glab/)
- Maintained by [Caleb Maclennan ](https://github.com/alerque)
- [Snap](https://gitlab.com/gitlab-org/cli#snapcraft) (up to date)
- Published to https://snapcraft.io/glab
- Maintained by [Clement Sam](https://github.com/profclems)
- Build config is in our repository: https://gitlab.com/gitlab-org/cli/-/blob/main/snap/snapcraft.yaml
- Documentation for releasing snaps on `snapcraft.io` https://snapcraft.io/docs/releasing-your-app
- [Kiss](https://gitlab.com/gitlab-org/cli#kiss-linux) (out of date)
- Last updated 2 years ago
- There is a community repository with `gitlab-glab` package https://github.com/dylanaraps/community, but it's been archived
- The "official" repository https://github.com/kiss-community/community doesn't contain `gitlab-glab` package
- Maintained by [Daniel M. Matongo](https://github.com/mmatongo)
- I think it's safe to not consider this Kiss distribution channel
- [Alpine](https://gitlab.com/gitlab-org/cli#alpine-linux) (up to date)
- `glab` package in [Alpine Community Repo](https://git.alpinelinux.org/aports/tree/community/glab?h=master)
- Maintained by the community https://git.alpinelinux.org/aports/log/community/glab/APKBUILD
- [NixOS](https://gitlab.com/gitlab-org/cli#nixnixos) (up to date)
- `glab` package https://search.nixos.org/packages?channel=unstable&show=glab&from=0&size=30&sort=relevance&query=glab
- Configuration in https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/version-management/git-and-tools/glab/default.nix#L37
- Maintainers:
- freezeboy <freezeboy@users.noreply.github.com>
- Wael Nasreddine <wael.nasreddine@gmail.com>
### Docker
- Docker Registry `profclems/glab` (up to date)
- Published to docker image on [`registry.hub.docker.com`](https://registry.hub.docker.com/r/profclems/glab/tags)
- Maintained by [Clement Sam](https://github.com/profclems)
- Since the image has got the `profclems` in the name, it would make the most sense if the `profclems` image gets deprecated, and we'll create a `gitlab/glab` image similar to [gitlab/gitlab-runner](https://registry.hub.docker.com/r/gitlab/gitlab-runner)
- GitHub container registry [`ghcr.io/profclems/glab`](https://github.com/profclems/glab/pkgs/container/glab) (up to date)
- We should also deprecate this image.
### Windows
- [WinGet](https://gitlab.com/gitlab-org/cli#winget) (up to date)
- Package in https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/GLab/GLab
- Automatcially updated by [`vedantmgoyal2009/vedantmgoyal2009`](https://github.com/vedantmgoyal2009/vedantmgoyal2009/blob/eda1dc809184b4aa2f735286ee664dce7b30e972/winget-pkgs-automation/packages.txt) project
- I think we would have to create a PR similar to https://github.com/microsoft/winget-pkgs/pull/40398/files to create a new version and change the manifest to point to the `gitlab-org/gitlab` project
- Example: [GitLab runner package](https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/Gitlab/Runner/15.2.1)
- [Scoop](https://gitlab.com/gitlab-org/cli#scoop) (up-to-date)
- https://github.com/ScoopInstaller/Main/blob/master/bucket/glab.json
- It seems that [Clement Sam](https://github.com/profclems) [added the first definition of the package](https://github.com/ScoopInstaller/Main/commit/712ba9429b0c844133a9d36ad584766add0d6658) and since then it auto-updates. This means that scoop is [connected to the GitHub repository](https://github.com/ScoopInstaller/Main/blob/master/bucket/glab.json#L17) for version updates.
- When we'll ask the maintainers (with PR) to change the main repository for `glab`, we should have a message from [Clement Sam](https://github.com/profclems) permitting us to migrate the repo.
- Standalone `exe` installer
- This item is odd-one-out. It's not a distribution channel per se. It is a CI job wrapping the `glab.exe` binary in an installation job. This is a dependency of the WinGet distribution channel. I don't know why we must generate an installer for a single binary.
- The project uses [Inno Setup](https://jrsoftware.org/isinfo.php) to generate the installer.
- The action that generates and releases the installer is in [`release.yml`](https://gitlab.com/gitlab-org/cli/blob/3a67d4a835b66aa9c1ce2dce189874fddc32346a/.github/workflows/release.yml#L103-155)
- The Inno Setup config file is in [`setup_windows.iss`](https://gitlab.com/gitlab-org/cli/blob/48acd838ee0344ed071eca1dc00c1056c53544ba/scripts/setup_windows.iss#L12)
- Documentation for Inno Setup is at https://jrsoftware.org/ishelp/
epic