diff --git a/Makefile b/Makefile index 58309a7..7b84269 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ clean: rm -f docopts-* docopts README.tmp dist/* snapshot: install_builddep - GOVERSION=$(GOVERSION) goreleaser build --rm-dist --snapshot --single-target -o docopts + GOVERSION=$(GOVERSION) goreleaser build --rm-dist --snapshot -o docopts release: clean all test snapshot GOVERSION=$(GOVERSION) goreleaser release diff --git a/docs/pre_built_binaries.md b/docs/pre_built_binaries.md index cb539e6..e1b86a7 100644 --- a/docs/pre_built_binaries.md +++ b/docs/pre_built_binaries.md @@ -17,73 +17,48 @@ Or we provide a command line helper if you cloned this repository, that will simply download the good binary format from our repository and provide a `docopts` binary in your current folder. - ``` ./get_docopts.sh ``` ## Release binaries -This section is for developper. In order to release binaries you will need +This section is for developers. In order to release binaries you will need some granted access to github API. -You will also need some more developper tools. - -Most of the tools require a working [Go developper -environment](https://golang.org/doc/code.html#Organization). Which should not be too -complicated to setup. +You will also need some more developer tools. -All dependancies are installed in your Go workspace with: +All dependencies are installed with: ``` make install_builddep ``` -Go for it: - -### gox - -We provide binaries cross-compiled from GNU/Linux using [gox](https://github.com/mitchellh/gox) - -``` -go get github.com/mitchellh/gox -``` - -### govvv - -Get version information to be embedded in binary at compile time - -``` -go get github.com/ahmetb/govvv -``` - -### github release uploader +### `goreleaser` -We publish release using a command line tools and using github API [gothub](https://github.com/itchio/gothub) +[`goreleaser`](https://github.com/goreleaser/goreleaser) is used to cross-compile binaries for different platforms as well publish GitHub releases. -``` -go get github.com/itchio/gothub -``` +See the [`.goreleaser.yml`](../goreleaser.yml) for the configuration. ### github API token -You will need a valid gitub token for the target repository. +You will need a valid github token for the target repository. https://help.github.com/articles/creating-an-access-token-for-command-line-use -The token needs to have `repos` auth priviledges. +The token needs to have `repo` auth privileges. Then export it as a bash environment variable: ``` -export GITHUB_TOKEN="you token here" +export GITHUB_TOKEN="your token here" ``` -### git tag a new release +### `git tag` a new release We use [semantic verion tags](https://semver.org/) -Our version is stored in VERSION file to be used by `govvv`. +Our version is stored in `VERSION` file. ``` echo "v0.6.3-alpha2" > VERSION @@ -91,78 +66,20 @@ git tag -a "$(cat VERSION)" -m "golang 2019" git push origin "$(cat VERSION)" ``` -### yaml command-line tool - -See: http://mikefarah.github.io/yq/ - -For extracting yaml data from `deployment.yml` - -``` -go get gopkg.in/mikefarah/yq.v2 -``` - - -## deploy / publish release - -We provide a deploy script, which will take the last git tag, and a deployment -message written in a yaml file `deployment.yml`. - -The script can be downloaded from https://github.com/opensource-expert/deploy.sh - -### install `deploy.sh` - -`deploy.sh` uses `docopts` for parsing our command line option. So you will need to build a first `docopts` and having -it installed in th PATH - -build `docopts`: - -``` -cd path/to/docopt/docopts -make -``` - -clone and install `deploy.sh` (will be installed by default in `PREFIX=${HOME}/.local` - -``` -git clone https://github.com/opensource-expert/deploy.sh deploy_sh -cd deploy_sh -make -make install -``` - -if your `${HOME}/.local/bin` is not in your PATH - -``` -PATH=$PATH:${HOME}/.local/bin -``` - -test - -``` -deploy.sh -h -``` - ### deployment steps In `docopts` project folder. -So you need to create the release text in `deployment.yml` before you run -`deploy.sh`. - -See what will going on (dry-run): - -``` -deploy.sh deploy -n -``` +You need to create the release text in `deployment.yml` first. -Deploy and replace existing binaries for this release. +Dry-run to create release files and binaries in the `dist/` dir: ``` -deploy.sh deploy --replace +make snapshot ``` -Only build binaries in `build/` dir: +Publish the binaries and release notes: ``` -deploy.sh build +make release ``` diff --git a/docs/release.md b/docs/release.md index 6da20d9..462dba8 100644 --- a/docs/release.md +++ b/docs/release.md @@ -82,13 +82,10 @@ git tag ## 9. build the release -With [deploy.sh](https://github.com/opensource-expert/deploy.sh) installed in our PATH -Note: `deploy.sh` use `docopts` and `docopts.sh` in the PATH - The following will build all binary version from `deployment.yml` ``` -deploy.sh build +make snapshot ``` ## 10. push the tag on docopts @@ -99,11 +96,7 @@ git push docopts $(cat ./VERSION) ## 11. deploy the release -load github env - ``` -. ./env -export GITHUB_USER=docopt -export GITHUB_REPO=docopts -deploy.sh deploy +export GITHUB_TOKEN="your token here" +make release ```