Commit graph

48 commits

Author SHA1 Message Date
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
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
02f5a68937 Move main package to under cmd/
It's a Go convention that main packages (one per each binary produced) are
scoped under `cmd/`.

https://github.com/github/go-lang/blob/master/docs/style-guide.md#directory-structure-and-filenames-layout
2020-01-23 10:45:28 +01:00
Mislav Marohnić
a7f59bfb15 Improve site-docs make task
This ensures that upstream changes to the `gh-pages` branches are pulled
before trying to upload new site docs.
2019-12-16 15:59:46 +01:00
Mislav Marohnić
9425d33b3d Merge pull request #127 from github/help-site
Generate help docs to GitHub Pages
2019-12-05 18:37:46 +01:00
Mislav Marohnić
ba0a441e23 Allow configuring the update notifier from the outside
To test the update notifier:

    rm -f bin/gh; GH_VERSION=v0.2.3 LDFLAGS='-X main.updaterEnabled=github/homebrew-gh' make
2019-12-04 15:07:10 +01:00
Mislav Marohnić
39080dc332 Generate help docs to GitHub Pages
`make site-docs`:
1. checks out the `gh-pages` branch into the `site/` directory;
2. regenerates `.md` help pages using Cobra;
3. commits and publishes updates.
2019-11-28 16:43:07 +01:00
Mislav Marohnić
4a5ed81577 Fix injecting version information into build from git
This was a typo. Note that Makefile is only used for building a
development version after cloning from git; the tagged release process
uses `.goreleaser.yml` and skips the Makefile.
2019-11-19 09:01:18 +01:00
Mislav Marohnić
e7bebaeebc Inject production OAuth client ID+secret into release 2019-11-08 18:57:22 +01:00
Mislav Marohnić
0bf3e7500c Add --version flag support 2019-10-31 12:14:55 +01:00
Mislav Marohnić
8016d80884 Create overridable Context interface 2019-10-17 02:25:59 +02:00
Mislav Marohnić
e867322ec4 Add Makefile 2019-10-07 16:58:29 +02:00