Commit graph

61 commits

Author SHA1 Message Date
William Martin
18dc5e77f0 Add sampled command telemetry 2026-04-16 21:42:46 +02:00
Kynan Ware
85ae53e702
Merge branch 'trunk' into build/customize-prefix 2026-03-03 20:08:56 -07:00
William Martin
7ea88b1c4d
Bundle licenses at release time (#12625)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-02-18 17:59:27 +01:00
scarf
350a1d6428
build: customizable install prefix 2025-12-13 01:13:25 +09:00
Andy Feller
11e8a8127d Use make for license generation and checks 2025-06-20 16:53:11 -04:00
William Martin
7066bdb66f
Add comment to acceptance make target
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2024-10-15 17:33:18 +01:00
William Martin
ae37c25d25 Add acceptance task to makefile 2024-10-14 20:24:07 +02:00
paulober
74392ff654
Added make macospkg target
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
2024-05-24 15:25:02 +02:00
Biswapriyo Nath
591fcafd9c
Make: Fix target name for Windows platform (#7370)
This fixes the taget name by adding .exe extension for Windows platform.
Otherwise, the following error is shown with `make bin/gh.exe' command.

    make: *** No rule to make target 'script/build', needed by 'bin/gh.exe'.  Stop.
2023-05-09 20:23:54 +02:00
Mislav Marohnić
8b987e2deb
New deployment workflow
Add ability to trigger deployments without having to push a git tag
2023-05-09 20:23:54 +02:00
Aleksei Khudiakov
c64032b981
Fix Makefile compatibility with macOS
`install` command on macOS does not support all flags supported by coreutils version.
Create directories as separate `install -d` call.

Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
2023-04-26 00:39:56 +10:00
Aleksei Khudiakov
80f91af171
Move completions generation from goreleaser to Makefile 2023-04-08 11:31:09 +10:00
Mislav Marohnić
d43720620e Tweak build scripts to enable cross-compiling
The main build script for this project is `script/build.go` which
implements Makefile-like building of the `gh` binary and associated man
pages. Our Makefile defers to the Go script.

However, when setting GOOS, GOARCH, and other environment variables to
modify the target for the resulting binary, these environment variables
would affect the execution of `build.go` as well, which was unintended.

This tweaks our Makefile to reset variables like GOOS and GOARCH when
building the `build.go` script itself, ensuring that the built script
runs on the same platform, and adds the ability to pass environment
variables as arguments to `go run script/build.go`. This allows the
following usage on platforms without `make`:

    go run script/build.go GOOS=linux

With this style of invocation, the GOOS setting does not actually affect
`go run` itself; just the `go build` that is executed in a child process.
2021-04-09 15:48:12 +02:00
Mislav Marohnić
3673a9beb2 Add more documentation for script/build.go 2021-01-21 17:16:11 +01:00
Mislav Marohnić
39431a101d Port select portions of Makefile to script/build.go
This is to enable build tasks on Windows.
2021-01-08 22:35:57 +01:00
Ismael Luceno
d7f68e9ee2 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
2020-12-08 22:39:38 +01:00
Mislav Marohnić
a84b9f09d4
Merge pull request #2456 from ismaell/build-flags
Simplify build flags setup
2020-12-01 20:52:32 +01:00
Mislav Marohnić
c92f416cc0 Simplify make install/uninstall 2020-12-01 15:46:18 +01:00
Ismael Luceno
8d2881d5ea Install manual pages 2020-11-29 21:01:38 +01:00
Ismael Luceno
da3287c26c Add make (un)install targets for POSIX systems
The implementation imitates the behavior of build-systems generated by
GNU Automake.

Implemented targets:
- install
- install-strip
- uninstall

Implemented variables:
- DESTDIR
- prefix
- bindir
- INSTALL_STRIP_FLAG

Internal implementation details:

- install-bins variable collects user binaries to be installed
- install-dirs variable collects directories to be created
2020-11-29 21:01:38 +01:00
Ismael Luceno
a4daf96a69 Make bin/gh rule verbose 2020-11-21 23:17:54 +01:00
Ismael Luceno
e16bf094bd Simplify CGO flags setup 2020-11-21 23:16:42 +01:00
Sam
f8ce68f062
Remove SEE ALSO from markdown docs generation 2020-10-22 12:59:11 +02:00
Sam Coe
f0b534f92e
Move build to internal 2020-10-21 13:31:32 +02:00
Sam Coe
9df3bd9344
Change command pkg to build pkg 2020-10-21 11:16:49 +02:00
zacanger
f6aa6b0980
chore: add make clean to remove bin and manpages (#1776) 2020-09-18 18:20:55 +02:00
vilmibm
15bfb5447b split auth flow code into new internal package 2020-09-10 12:13:48 -05:00
Mislav Marohnić
a983131479 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
2020-09-07 16:11:27 +02:00
Mislav Marohnić
6c08cd696f Enable adding to GO_LDFLAGS without having to replace them all
To produce a slimmer binary, this is now supported:

    GO_LDFLAGS="-s -w" GH_VERSION="vX.Y.Z" make
2020-07-17 13:46:37 +02:00
Mislav Marohnić
909aff827c Use makefile append operator 2020-07-10 13:41:55 +02:00
Mislav Marohnić
0ed8c0645c Fix version and OAuth client information being injected via make 2020-07-07 16:01:14 +02:00
Eli Schwartz
9bbdf4af99
Make: properly add environment C compiler flags to CGO
Do not pass LDFLAGS as arguments to -ldflags, since these are passed to
'go tool link' and C compiler ldflags need to be passed as
-ldflags "-extldflags \"$LDFLAGS\"" with unreliable handling. Instead
copy over (unmodified) the standard environment variable to the special
golang-specific variable which the go compiler chooses to respect.

While we are at it, handle CPPFLAGS and CFLAGS too.
2020-07-01 11:04:51 -04:00
Mislav Marohnić
bee132300c Fix overriding OAuth client ID & secret at build time 2020-06-03 13:44:04 +02:00
vilmibm
affe4dc3eb do not yet try and use gh from makefile bc of CI 2020-05-26 12:12:31 -05:00
Nate Smith
e9d6e13339
Merge pull request #915 from mtfurlan/docs/manpage
Generate manpages from cobra
2020-05-20 09:58:50 -05:00
Mark Furland
af93bab887 remove unnecessary mkdir from makefile 2020-05-19 22:42:44 -04:00
Mark Furland
6387078532 add make manpages hook and fix makefile 2020-05-19 22:40:14 -04:00
Mark Furland
db2fac93ea generate manpages into ./share/man/man1 2020-05-19 18:43:26 -04:00
vilmibm
14e8498b90 fix path 2020-05-18 15:14:10 -05:00
vilmibm
d2bdd53dd2 depend on bin/gh 2020-05-18 15:08:31 -05:00
vilmibm
d800e3f0b6 rely on environment 2020-05-18 15:07:28 -05:00
vilmibm
da95cbd1bf use gh if available when cloning site 2020-05-18 14:05:50 -05:00
vilmibm
296062b869 configure author on site commits 2020-05-18 14:01:35 -05:00
Mark Furland
e33706fbf4 Add flags for man vs website to cmd/gen-docs 2020-05-12 09:51:25 -04:00
Mark Furland
92130d91ba Minimal manpage generation from cobra 2020-05-12 09:10:09 -04:00
Mislav Marohnić
83502fdbae Avoid failing if site docs are already up-to-date 2020-04-22 16:13:16 +02:00
Mislav Marohnić
60a67b852a Automatically generate site docs on release 2020-04-22 15:59:44 +02:00
Mislav Marohnić
030538871d Fix make site-docs 2020-03-03 23:34:32 +01:00
Morten Linderud
1b7009087e
[Makefile] Support reproducible builds
It's bad form to embed timestamps in binaries as it prevents
reproducible builds of the resulting binary.

The Reproducible Builds project defines SOURCE_DATE_EPOCH to help
reproduce binaries by allowing the date format to be overridden. This
patch adds support for this for GNU and BSD date.

Go 1.13 introduces `-trimpath` which strips build paths from all
compiled binaries. This enables people to reproduce the distributed cli
binary without having to recreate the build path.

https://reproducible-builds.org/specs/source-date-epoch/
https://reproducible-builds.org/docs/build-path/

Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-02-13 11:22:04 +01:00
Mislav Marohnić
04aff00798 Update make site-docs to reflect latest setup
- Man pages are now placed under `/manual/`
- Use Jekyll `permalink` to avoid the `.html` extension
- Strip "SEE ALSO" and everything after it
2020-01-31 15:35:57 +01:00