From 894be0392359428e862173541dd3d175ea90da58 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Mon, 3 Aug 2020 16:37:21 -0500 Subject: [PATCH 1/5] linux repo creation --- .github/workflows/releases.yml | 112 +++++++++++++++++++++++++++++++++ script/distributions | 16 +++++ script/override.focal | 2 + script/pubkey.asc | 41 ++++++++++++ script/rpmmacros | 1 + 5 files changed, 172 insertions(+) create mode 100644 script/distributions create mode 100644 script/override.focal create mode 100644 script/pubkey.asc create mode 100644 script/rpmmacros diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 1c3baa6e8..00260ca16 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -62,6 +62,118 @@ jobs: api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; } cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id") for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done + rpm-repos: + if: "!contains(github.ref, '-')" # skip prereleases + needs: goreleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get package artifacts + uses: i3h/download-release-asset@v1 + with: + owner: cli + repo: cli + tag: latest + file: .*.rpm + - name: install createrepo, rpm + run: sudo apt-get install -y createrepo rpm + - name: set up gpg + run: | + echo "Importing pubkey..." + cat script/pubkey.asc | gpg --import --no-tty --batch --yes + echo "Importing seckey..." + echo ${{secrets.GPG_KEY}} | base64 -d | gpg --import --no-tty --batch --yes + echo "Resetting gpg-agent and ingesting passphrase" + echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf + gpg-connect-agent RELOADAGENT /bye + echo ${{secrets.GPG_PASSPHRASE}} | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5 + - name: Sign RPMs + run: | + cp script/rpmmacros ~/.rpmmacros + rpmsign --addsign *.rpm + - name: Checkout pages site + uses: actions/checkout@v2 + with: + repository: github/cli.github.com + path: site + fetch-depth: 0 + token: ${{secrets.SITE_GITHUB_TOKEN}} + - name: run createrepo + run: | + cp *.rpm site/packages/rpm/ + createrepo site/packages/rpm + cd site/packages/rpm && gpg --yes --detach-sign --armor repodata/repomd.xml + cd ../../../ + - name: publish site + env: + GIT_COMMITTER_NAME: cli automation + GIT_AUTHOR_NAME: cli automation + GIT_COMMITTER_EMAIL: noreply@github.com + GIT_AUTHOR_EMAIL: noreply@github.com + run: | + git -C site add packages + git -C site commit -m"${GITHUB_REF} rpm packages" + git -C site push + + deb-repos: + if: "!contains(github.ref, '-')" # skip prereleases + needs: goreleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get package artifacts + uses: i3h/download-release-asset@v1 + with: + owner: cli + repo: cli + tag: latest + file: .*.deb + - name: install reprepro + run: sudo apt-get install -y reprepro + - name: set up gpg + run: | + echo "Importing pubkey..." + cat script/pubkey.asc | gpg --import --no-tty --batch --yes + echo "Importing seckey..." + echo ${{secrets.GPG_KEY}} | base64 -d | gpg --import --no-tty --batch --yes + echo "Resetting gpg-agent and ingesting passphrase" + echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf + gpg-connect-agent RELOADAGENT /bye + echo ${{secrets.GPG_PASSPHRASE}} | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5 + - name: run reprepro + env: + RELEASES: "focal stable" + run: | + mkdir upload + for release in $RELEASES; do + for file in *.deb ; do + /usr/bin/reprepro --confdir="+b/script" includedeb $release $file; + done + done + - name: "Select repo artifacts" + # Select only final repo artifacts (this makes reprepro runs stateless) + run: cp -a dists/ pool/ upload/ + - name: Checkout pages site + uses: actions/checkout@v2 + with: + repository: github/cli.github.com + path: site + fetch-depth: 0 + token: ${{secrets.SITE_GITHUB_TOKEN}} + - name: add files to site + run: cp -a upload/* site/packages/ + - name: publish site + env: + GIT_COMMITTER_NAME: cli automation + GIT_AUTHOR_NAME: cli automation + GIT_COMMITTER_EMAIL: noreply@github.com + GIT_AUTHOR_EMAIL: noreply@github.com + run: | + git -C site add packages + git -C site commit -m"${GITHUB_REF} deb packages" + git -C site push msi: needs: goreleaser runs-on: windows-latest diff --git a/script/distributions b/script/distributions new file mode 100644 index 000000000..67536e4c2 --- /dev/null +++ b/script/distributions @@ -0,0 +1,16 @@ +Origin: gh +Label: gh +Codename: stable +Architectures: i386 amd64 arm64 +Components: main +Description: The GitHub CLI - debian stable repo +SignWith: C99B11DEB97541F0 + +Origin: gh +Label: gh +Codename: focal +Architectures: i386 amd64 arm64 +Components: main +Description: The GitHub CLI - ubuntu focal repo +SignWith: C99B11DEB97541F0 +DebOverride: override.focal diff --git a/script/override.focal b/script/override.focal new file mode 100644 index 000000000..89ab311a7 --- /dev/null +++ b/script/override.focal @@ -0,0 +1,2 @@ +gh Priority optional +gh Section Development diff --git a/script/pubkey.asc b/script/pubkey.asc new file mode 100644 index 000000000..9c313b43d --- /dev/null +++ b/script/pubkey.asc @@ -0,0 +1,41 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +thQyULWTJXRidPWVyWWqegyubCbY0cY= +=ki4q +-----END PGP PUBLIC KEY BLOCK----- diff --git a/script/rpmmacros b/script/rpmmacros new file mode 100644 index 000000000..fdfb48a29 --- /dev/null +++ b/script/rpmmacros @@ -0,0 +1 @@ +%_gpg_name Nate Smith From deb92f93a69bbf6d0c41f9d0e0534783bc63ae04 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Thu, 3 Sep 2020 14:48:17 -0500 Subject: [PATCH 2/5] update linux installation docs --- README.md | 59 +++++++++++++++-------------------- docs/install_linux.md | 72 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 docs/install_linux.md diff --git a/README.md b/README.md index 01f18ab74..5367402f8 100644 --- a/README.md +++ b/README.md @@ -107,48 +107,40 @@ MSI installers are available for download on the [releases page][]. ### Debian/Ubuntu Linux -Install and upgrade: - -1. Download the `.deb` file from the [releases page][]; -2. Install the downloaded file: `sudo apt install ./gh_*_linux_amd64.deb` - -### Fedora Linux - -Install and upgrade: - -1. Download the `.rpm` file from the [releases page][]; -2. Install the downloaded file: `sudo dnf install gh_*_linux_amd64.rpm` - -### Centos Linux - -Install and upgrade: - -1. Download the `.rpm` file from the [releases page][]; -2. Install the downloaded file: `sudo yum localinstall gh_*_linux_amd64.rpm` - -### openSUSE/SUSE Linux - -Install and upgrade: - -1. Download the `.rpm` file from the [releases page][]; -2. Install the downloaded file: `sudo zypper in gh_*_linux_amd64.rpm` - -### Arch Linux - -Arch Linux users can install from the [community repo][arch linux repo]: +Install: ```bash -pacman -S github-cli +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 +sudo apt-add-repository -u https://cli.github.com/packages +sudo apt install gh ``` -### Android +Upgrade: -Android users can install via Termux: +``` +sudo apt update +sudo apt install gh +``` + +### Fedora, Centos, Red Hat Linux + +Install: ```bash -pkg install gh +sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo +sudo dnf install gh ``` +Upgrade: + +```bash +sudo dnf install gh +``` + +### Other Linux + +See [Linux installation docs](/docs/install_linux.md) + ### Other platforms Download packaged binaries from the [releases page][]. @@ -164,5 +156,4 @@ See here on how to [build GitHub CLI from source][build from source]. [hub]: https://github.com/github/hub [contributing page]: https://github.com/cli/cli/blob/trunk/.github/CONTRIBUTING.md [gh-vs-hub]: /docs/gh-vs-hub.md -[arch linux repo]: https://www.archlinux.org/packages/community/x86_64/github-cli [build from source]: /docs/source.md diff --git a/docs/install_linux.md b/docs/install_linux.md new file mode 100644 index 000000000..062fa1983 --- /dev/null +++ b/docs/install_linux.md @@ -0,0 +1,72 @@ +# Installing gh on Linux + +The core, paid developers of `gh` officially support a `.deb` repository and a `.rpm` repository. We +primarily test against Ubuntu and Fedora but do our best to support other distros that can work with +our repositories. We focus on support for `amd64` and `i386` architectures. + +All other combinations of distro, packaging, or architecture should be considered community +supported. + +## Official methods + +### Debian/Ubuntu Linux (apt) + +Install: + +```bash +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 +sudo apt-add-repository -u https://cli.github.com/packages +sudo apt install gh +``` + +Upgrade: + +``` +sudo apt update +sudo apt install gh +``` + +### Fedora, Centos, Red Hat Linux (dnf) + +Install: + +```bash +sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo +sudo dnf install gh +``` + +Upgrade: + +```bash +sudo dnf install gh +``` + +## Community supported methods + +### openSUSE/SUSE Linux + +It's possible that https://cli.github.com/packages/rpm/gh-cli.repo will work with zypper but it +hasn't been tested. Otherwise, to install from package: + +Install and upgrade: + +1. Download the `.rpm` file from the [releases page][]; +2. Install the downloaded file: `sudo zypper in gh_*_linux_amd64.rpm` + +### Arch Linux + +Arch Linux users can install from the [community repo][arch linux repo]: + +```bash +pacman -S github-cli +``` + +### Android + +Android users can install via Termux: + +```bash +pkg install gh +``` + +[arch linux repo]: https://www.archlinux.org/packages/community/x86_64/github-cli From a983131479702652c62a13dc5c0a2ff5a2f2db99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 7 Sep 2020 16:11:27 +0200 Subject: [PATCH 3/5] Exercise most of the release process on prereleases - deb and rpm packages are now built for prereleases - consolidate setup for deb & rpm - man pages are generated for prereleases - the `cli.github.com` site is only pushed to on full releases Bonus: - only publish the GitHub release after the Windows MSI is uploaded - hub does not need downloading --- .github/workflows/releases.yml | 161 ++++++++++----------------------- .goreleaser.yml | 1 + Makefile | 5 +- 3 files changed, 53 insertions(+), 114 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 00260ca16..a9d13d200 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -27,153 +27,85 @@ jobs: args: release --release-notes=CHANGELOG.md env: GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}} - - name: Bump homebrew-core formula - uses: mislav/bump-homebrew-formula-action@v1 - if: "!contains(github.ref, '-')" # skip prereleases - with: - formula-name: gh - download-url: https://github.com/cli/cli.git - env: - COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} - name: Checkout documentation site - if: "!contains(github.ref, '-')" # skip prereleases uses: actions/checkout@v2 with: repository: github/cli.github.com path: site fetch-depth: 0 token: ${{secrets.SITE_GITHUB_TOKEN}} - - name: Publish documentation site - if: "!contains(github.ref, '-')" # skip prereleases + - name: Update site man pages env: GIT_COMMITTER_NAME: cli automation GIT_AUTHOR_NAME: cli automation GIT_COMMITTER_EMAIL: noreply@github.com GIT_AUTHOR_EMAIL: noreply@github.com - run: make site-publish + run: make site-bump - name: Move project cards - if: "!contains(github.ref, '-')" # skip prereleases + continue-on-error: true env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} PENDING_COLUMN: 8189733 DONE_COLUMN: 7110130 run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; } + api() { gh api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; } + api-write() { [[ $GITHUB_REF == *-* ]] && echo "skipping: api $*" || api "$@"; } cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id") - for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done - rpm-repos: - if: "!contains(github.ref, '-')" # skip prereleases - needs: goreleaser - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get package artifacts - uses: i3h/download-release-asset@v1 - with: - owner: cli - repo: cli - tag: latest - file: .*.rpm - - name: install createrepo, rpm - run: sudo apt-get install -y createrepo rpm - - name: set up gpg + for card in $cards; do + api-write projects/columns/cards/$card/moves -f position=top -F column_id=$DONE_COLUMN + done + + - name: Install packaging dependencies + run: sudo apt-get install -y createrepo rpm reprepro + - name: Set up GPG run: | - echo "Importing pubkey..." - cat script/pubkey.asc | gpg --import --no-tty --batch --yes - echo "Importing seckey..." - echo ${{secrets.GPG_KEY}} | base64 -d | gpg --import --no-tty --batch --yes - echo "Resetting gpg-agent and ingesting passphrase" + gpg --import --no-tty --batch --yes < script/pubkey.asc + echo "${{secrets.GPG_KEY}}" | base64 -d | gpg --import --no-tty --batch --yes echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf gpg-connect-agent RELOADAGENT /bye - echo ${{secrets.GPG_PASSPHRASE}} | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5 + echo "${{secrets.GPG_PASSPHRASE}}" | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5 - name: Sign RPMs run: | cp script/rpmmacros ~/.rpmmacros - rpmsign --addsign *.rpm - - name: Checkout pages site - uses: actions/checkout@v2 - with: - repository: github/cli.github.com - path: site - fetch-depth: 0 - token: ${{secrets.SITE_GITHUB_TOKEN}} - - name: run createrepo + rpmsign --addsign dist/*.rpm + - name: Run createrepo run: | - cp *.rpm site/packages/rpm/ + mkdir -p site/packages/rpm + cp dist/*.rpm site/packages/rpm/ createrepo site/packages/rpm - cd site/packages/rpm && gpg --yes --detach-sign --armor repodata/repomd.xml - cd ../../../ - - name: publish site - env: - GIT_COMMITTER_NAME: cli automation - GIT_AUTHOR_NAME: cli automation - GIT_COMMITTER_EMAIL: noreply@github.com - GIT_AUTHOR_EMAIL: noreply@github.com - run: | - git -C site add packages - git -C site commit -m"${GITHUB_REF} rpm packages" - git -C site push - - deb-repos: - if: "!contains(github.ref, '-')" # skip prereleases - needs: goreleaser - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get package artifacts - uses: i3h/download-release-asset@v1 - with: - owner: cli - repo: cli - tag: latest - file: .*.deb - - name: install reprepro - run: sudo apt-get install -y reprepro - - name: set up gpg - run: | - echo "Importing pubkey..." - cat script/pubkey.asc | gpg --import --no-tty --batch --yes - echo "Importing seckey..." - echo ${{secrets.GPG_KEY}} | base64 -d | gpg --import --no-tty --batch --yes - echo "Resetting gpg-agent and ingesting passphrase" - echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf - gpg-connect-agent RELOADAGENT /bye - echo ${{secrets.GPG_PASSPHRASE}} | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5 - - name: run reprepro + pushd site/packages/rpm + gpg --yes --detach-sign --armor repodata/repomd.xml + popd + - name: Run reprepro env: RELEASES: "focal stable" run: | - mkdir upload + mkdir -p upload for release in $RELEASES; do - for file in *.deb ; do - /usr/bin/reprepro --confdir="+b/script" includedeb $release $file; + for file in dist/*.deb; do + reprepro --confdir="+b/script" includedeb "$release" "$file" done done - - name: "Select repo artifacts" - # Select only final repo artifacts (this makes reprepro runs stateless) - run: cp -a dists/ pool/ upload/ - - name: Checkout pages site - uses: actions/checkout@v2 - with: - repository: github/cli.github.com - path: site - fetch-depth: 0 - token: ${{secrets.SITE_GITHUB_TOKEN}} - - name: add files to site - run: cp -a upload/* site/packages/ - - name: publish site + cp -a dists/ pool/ upload/ + mkdir -p site/packages + cp -a upload/* site/packages/ + - name: Publish site env: GIT_COMMITTER_NAME: cli automation GIT_AUTHOR_NAME: cli automation GIT_COMMITTER_EMAIL: noreply@github.com GIT_AUTHOR_EMAIL: noreply@github.com + working-directory: ./site run: | - git -C site add packages - git -C site commit -m"${GITHUB_REF} deb packages" - git -C site push + git add packages + git commit -m "Add rpm and deb packages for ${GITHUB_REF#refs/tags/}" + if [[ $GITHUB_REF == *-* ]]; then + git log --oneline @{upstream}.. + git diff --name-status @{upstream}.. + else + git push + fi + msi: needs: goreleaser runs-on: windows-latest @@ -184,8 +116,7 @@ jobs: id: download_exe shell: bash run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - bin/hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip' + hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip' printf "::set-output name=zip::%s\n" *.zip unzip -o *.zip && rm -v *.zip env: @@ -218,6 +149,14 @@ jobs: -Executable "${{ steps.buildmsi.outputs.msi }}" - name: Upload MSI shell: bash - run: bin/hub release edit "${GITHUB_REF#refs/tags/}" -m "" -a "${{ steps.buildmsi.outputs.msi }}" + run: hub release edit "${GITHUB_REF#refs/tags/}" -m "" --draft=false -a "${{ steps.buildmsi.outputs.msi }}" env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Bump homebrew-core formula + uses: mislav/bump-homebrew-formula-action@v1 + if: "!contains(github.ref, '-')" # skip prereleases + with: + formula-name: gh + download-url: https://github.com/cli/cli.git + env: + COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index fa6883834..ff1f9752d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,6 +2,7 @@ project_name: gh release: prerelease: auto + draft: true # we only publish after the Windows MSI gets uploaded before: hooks: diff --git a/Makefile b/Makefile index 0bffa784d..decf5125c 100644 --- a/Makefile +++ b/Makefile @@ -46,15 +46,14 @@ site-docs: site git -C site commit -m 'update help docs' || true .PHONY: site-docs -site-publish: site-docs +site-bump: site-docs ifndef GITHUB_REF $(error GITHUB_REF is not set) endif sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html rm -f site/index.html.bak git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html - git -C site push -.PHONY: site-publish +.PHONY: site-bump .PHONY: manpages From 44a500e50fd483a0528d264be0b1ded2299b0b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 7 Sep 2020 16:28:51 +0200 Subject: [PATCH 4/5] Remove Homebrew tap from goreleaser config Our tap is now deprecated in favor of `gh` from homebrew-core --- .goreleaser.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index ff1f9752d..e3f047c19 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -50,32 +50,6 @@ archives: files: - LICENSE -brews: - - name: gh - ids: [nix] - github: - owner: github - name: homebrew-gh - skip_upload: auto - description: GitHub CLI - homepage: https://github.com/cli/cli - folder: Formula - custom_block: | - head do - url "https://github.com/cli/cli.git", :branch => "trunk" - depends_on "go" - end - install: | - system "make", "bin/gh", "manpages" if build.head? - bin.install "bin/gh" - man1.install Dir["./share/man/man1/gh*.1"] - (bash_completion/"gh.sh").write `#{bin}/gh completion -s bash` - (zsh_completion/"_gh").write `#{bin}/gh completion -s zsh` - (fish_completion/"gh.fish").write `#{bin}/gh completion -s fish` - test: | - help_text = shell_output("#{bin}/gh --help") - assert_includes help_text, "Usage:" - nfpms: - license: MIT maintainer: GitHub From 016df6af1cdb4bef9a3b42ebcc1bb8aeca55c013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 7 Sep 2020 17:06:03 +0200 Subject: [PATCH 5/5] Consolidate Linux installation docs - Move all Linux installation docs to the separate page to eliminate repetition - Indicate that only Ubuntu 20.04 is supported for apt-add-repository method - Pull openSUSE/SUSE out of the "unofficial" section since it refers to downloading our official packages - Point out manual installation methods as well --- README.md | 41 +++++------------------------------------ docs/install_linux.md | 35 +++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 5367402f8..0981951a4 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ Upgrade: sudo port selfupdate && sudo port upgrade gh ``` +### Linux + +See [Linux installation docs](/docs/install_linux.md). + ### Windows `gh` is available via [scoop][], [Chocolatey][], and as downloadable MSI. @@ -105,42 +109,6 @@ choco upgrade gh MSI installers are available for download on the [releases page][]. -### Debian/Ubuntu Linux - -Install: - -```bash -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 -sudo apt-add-repository -u https://cli.github.com/packages -sudo apt install gh -``` - -Upgrade: - -``` -sudo apt update -sudo apt install gh -``` - -### Fedora, Centos, Red Hat Linux - -Install: - -```bash -sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo -sudo dnf install gh -``` - -Upgrade: - -```bash -sudo dnf install gh -``` - -### Other Linux - -See [Linux installation docs](/docs/install_linux.md) - ### Other platforms Download packaged binaries from the [releases page][]. @@ -149,6 +117,7 @@ Download packaged binaries from the [releases page][]. See here on how to [build GitHub CLI from source][build from source]. + [official docs]: https://cli.github.com/manual [scoop]: https://scoop.sh [Chocolatey]: https://chocolatey.org diff --git a/docs/install_linux.md b/docs/install_linux.md index 062fa1983..93e9f3efd 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -1,15 +1,15 @@ # Installing gh on Linux -The core, paid developers of `gh` officially support a `.deb` repository and a `.rpm` repository. We -primarily test against Ubuntu and Fedora but do our best to support other distros that can work with -our repositories. We focus on support for `amd64` and `i386` architectures. +Packages downloaded from https://cli.github.com or from https://github.com/cli/cli/releases +are considered official binaries. We focus on a couple of popular Linux distros and +the following CPU architectures: `386`, `amd64`, `arm64`. -All other combinations of distro, packaging, or architecture should be considered community -supported. +Other sources for installation are community-maintained and thus might lag behind +our release schedule. -## Official methods +## Official sources -### Debian/Ubuntu Linux (apt) +### Debian, Ubuntu 20.04 Linux (apt) Install: @@ -21,7 +21,7 @@ sudo apt install gh Upgrade: -``` +```bash sudo apt update sudo apt install gh ``` @@ -41,18 +41,27 @@ Upgrade: sudo dnf install gh ``` -## Community supported methods +### openSUSE/SUSE Linux (zypper) -### openSUSE/SUSE Linux +It's possible that https://cli.github.com/packages/rpm/gh-cli.repo will work with zypper, but +this hasn't been tested. -It's possible that https://cli.github.com/packages/rpm/gh-cli.repo will work with zypper but it -hasn't been tested. Otherwise, to install from package: +## Manual installation + +* [Download release binaries][releases page] that match your platform; or +* [Build from source](./source.md). + +### openSUSE/SUSE Linux (zypper) Install and upgrade: 1. Download the `.rpm` file from the [releases page][]; 2. Install the downloaded file: `sudo zypper in gh_*_linux_amd64.rpm` +## Community-supported methods + +Our team does do not directly maintain the following packages or repositories. + ### Arch Linux Arch Linux users can install from the [community repo][arch linux repo]: @@ -69,4 +78,6 @@ Android users can install via Termux: pkg install gh ``` + +[releases page]: https://github.com/cli/cli/releases/latest [arch linux repo]: https://www.archlinux.org/packages/community/x86_64/github-cli