From 03949a4d72bf1f39887126c040dcf5ef2bf295bd Mon Sep 17 00:00:00 2001 From: Pete Woods Date: Mon, 7 Dec 2020 12:53:32 +0000 Subject: [PATCH 1/4] Build static binaries Fixes #2555 --- .github/workflows/go.yml | 2 ++ .goreleaser.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 83fa87b8e..1d9613f04 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -39,4 +39,6 @@ jobs: uses: actions/checkout@v2 - name: Build + env: + CGO_ENABLED: '0' run: go build -v ./cmd/gh diff --git a/.goreleaser.yml b/.goreleaser.yml index f04e7f7f2..3146b9c6f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -25,6 +25,8 @@ builds: id: linux goos: [linux] goarch: [386, amd64, arm64] + env: + - CGO_ENABLED=0 - <<: *build_defaults id: windows From d7f68e9ee2182417e9124bace0890203f6993868 Mon Sep 17 00:00:00 2001 From: Ismael Luceno Date: Tue, 8 Dec 2020 22:39:38 +0100 Subject: [PATCH 2/4] Filter flags taken from LDFLAGS into CGO_LDFLAGS Make sure we take only flags compatible with cgo. Solves: https://github.com/cli/cli/issues/2577 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 22f3672b7..e29d67b07 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CGO_CPPFLAGS ?= ${CPPFLAGS} export CGO_CPPFLAGS CGO_CFLAGS ?= ${CFLAGS} export CGO_CFLAGS -CGO_LDFLAGS ?= ${LDFLAGS} +CGO_LDFLAGS ?= $(filter -g -L% -l% -O%,${LDFLAGS}) export CGO_LDFLAGS GO_LDFLAGS := -X github.com/cli/cli/internal/build.Version=$(GH_VERSION) $(GO_LDFLAGS) From f853a4b0e2d389206a9f641325ed3ca9e94fb91d Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Wed, 9 Dec 2020 00:25:21 +0000 Subject: [PATCH 3/4] Allow API request to be made if the PR is in an unknown state --- pkg/cmd/pr/merge/merge.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/cmd/pr/merge/merge.go b/pkg/cmd/pr/merge/merge.go index d72ed2ca0..abd761807 100644 --- a/pkg/cmd/pr/merge/merge.go +++ b/pkg/cmd/pr/merge/merge.go @@ -123,9 +123,6 @@ func mergeRun(opts *MergeOptions) error { if pr.Mergeable == "CONFLICTING" { err := fmt.Errorf("%s Pull request #%d (%s) has conflicts and isn't mergeable ", cs.Red("!"), pr.Number, pr.Title) return err - } else if pr.Mergeable == "UNKNOWN" { - err := fmt.Errorf("%s Pull request #%d (%s) can't be merged right now; try again in a few seconds", cs.Red("!"), pr.Number, pr.Title) - return err } else if pr.State == "MERGED" { err := fmt.Errorf("%s Pull request #%d (%s) was already merged", cs.Red("!"), pr.Number, pr.Title) return err From 1fb542250ad7cb5c25660165ad6d93735db7de5e Mon Sep 17 00:00:00 2001 From: Guangyuan Yang Date: Mon, 14 Dec 2020 13:51:36 +0800 Subject: [PATCH 4/4] Document installation instructions for FreeBSD --- docs/install_linux.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/install_linux.md b/docs/install_linux.md index 697bfb8f8..4fe314777 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -1,4 +1,4 @@ -# Installing gh on Linux +# Installing gh on Linux and FreeBSD Packages downloaded from https://cli.github.com or from https://github.com/cli/cli/releases are considered official binaries. We focus on popular Linux distros and @@ -101,6 +101,20 @@ Android 7+ users can install via [Termux](https://wiki.termux.com/wiki/Main_Page pkg install gh ``` +### FreeBSD + +FreeBSD users can install from the [ports collection](https://www.freshports.org/devel/gh/): + +```bash +cd /usr/ports/devel/gh/ && make install clean +``` + +Or via [pkg(8)](https://www.freebsd.org/cgi/man.cgi?pkg(8)): + +```bash +pkg install gh +``` + ### Gentoo Gentoo Linux users can install from the [main portage tree](https://packages.gentoo.org/packages/dev-util/github-cli):