Skip to content

Commit 6d289d3

Browse files
committed
docs(dev): update binaries and release w/ goreleaser changes
- hadn't seen these docs before, so updating them to match all the `goreleaser` changes - no need to install various deps, just `goreleaser` with `go mod tidy` - no need to install and run `deploy.sh`, just `make snapshot` and `make release` - update `make snapshot` to remove `--single-target` so that it will build all binaries as a dry-run - since it's no longer needed for the default target build, can make it output all binaries - TODO: modify changelog / release notes / versioning to match Sylvain's current style - Didn't change some references to `VERSION` and `deployment.yml` as I will likely make those work with `goreleaser` - also fix some typos: - "developper" -> "developer" - "dependancies" -> "dependencies" - "gitub" -> "github" - "repos" -> "repo" - "you" -> "your" - "priviledges" -> "privileges" - etc
1 parent ae7431b commit 6d289d3

File tree

3 files changed

+20
-110
lines changed

3 files changed

+20
-110
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ clean:
3636
rm -f docopts-* docopts README.tmp dist/*
3737

3838
snapshot: install_builddep
39-
GOVERSION=$(GOVERSION) goreleaser build --rm-dist --snapshot --single-target -o docopts
39+
GOVERSION=$(GOVERSION) goreleaser build --rm-dist --snapshot -o docopts
4040

4141
release: clean all test snapshot
4242
GOVERSION=$(GOVERSION) goreleaser release

Diff for: docs/pre_built_binaries.md

+16-99
Original file line numberDiff line numberDiff line change
@@ -17,152 +17,69 @@ Or we provide a command line helper if you cloned this repository, that will
1717
simply download the good binary format from our repository and provide a `docopts` binary in
1818
your current folder.
1919

20-
2120
```
2221
./get_docopts.sh
2322
```
2423

2524
## Release binaries
2625

27-
This section is for developper. In order to release binaries you will need
26+
This section is for developers. In order to release binaries you will need
2827
some granted access to github API.
2928

30-
You will also need some more developper tools.
31-
32-
Most of the tools require a working [Go developper
33-
environment](https://golang.org/doc/code.html#Organization). Which should not be too
34-
complicated to setup.
29+
You will also need some more developer tools.
3530

36-
All dependancies are installed in your Go workspace with:
31+
All dependencies are installed with:
3732

3833
```
3934
make install_builddep
4035
```
4136

42-
Go for it:
43-
44-
### gox
45-
46-
We provide binaries cross-compiled from GNU/Linux using [gox](https://github.com/mitchellh/gox)
47-
48-
```
49-
go get github.com/mitchellh/gox
50-
```
51-
52-
### govvv
53-
54-
Get version information to be embedded in binary at compile time
55-
56-
```
57-
go get github.com/ahmetb/govvv
58-
```
59-
60-
### github release uploader
37+
### `goreleaser`
6138

62-
We publish release using a command line tools and using github API [gothub](https://github.com/itchio/gothub)
39+
[`goreleaser`](https://github.com/goreleaser/goreleaser) is used to cross-compile binaries for different platforms as well publish GitHub releases.
6340

64-
```
65-
go get github.com/itchio/gothub
66-
```
41+
See the [`.goreleaser.yml`](../goreleaser.yml) for the configuration.
6742

6843
### github API token
6944

70-
You will need a valid gitub token for the target repository.
45+
You will need a valid github token for the target repository.
7146

7247
https://help.github.com/articles/creating-an-access-token-for-command-line-use
7348

74-
The token needs to have `repos` auth priviledges.
49+
The token needs to have `repo` auth privileges.
7550

7651
Then export it as a bash environment variable:
7752

7853
```
79-
export GITHUB_TOKEN="you token here"
54+
export GITHUB_TOKEN="your token here"
8055
```
8156

82-
### git tag a new release
57+
### `git tag` a new release
8358

8459
We use [semantic verion tags](https://semver.org/)
8560

86-
Our version is stored in VERSION file to be used by `govvv`.
61+
Our version is stored in `VERSION` file.
8762

8863
```
8964
echo "v0.6.3-alpha2" > VERSION
9065
git tag -a "$(cat VERSION)" -m "golang 2019"
9166
git push origin "$(cat VERSION)"
9267
```
9368

94-
### yaml command-line tool
95-
96-
See: http://mikefarah.github.io/yq/
97-
98-
For extracting yaml data from `deployment.yml`
99-
100-
```
101-
go get gopkg.in/mikefarah/yq.v2
102-
```
103-
104-
105-
## deploy / publish release
106-
107-
We provide a deploy script, which will take the last git tag, and a deployment
108-
message written in a yaml file `deployment.yml`.
109-
110-
The script can be downloaded from https://github.com/opensource-expert/deploy.sh
111-
112-
### install `deploy.sh`
113-
114-
`deploy.sh` uses `docopts` for parsing our command line option. So you will need to build a first `docopts` and having
115-
it installed in th PATH
116-
117-
build `docopts`:
118-
119-
```
120-
cd path/to/docopt/docopts
121-
make
122-
```
123-
124-
clone and install `deploy.sh` (will be installed by default in `PREFIX=${HOME}/.local`
125-
126-
```
127-
git clone https://github.com/opensource-expert/deploy.sh deploy_sh
128-
cd deploy_sh
129-
make
130-
make install
131-
```
132-
133-
if your `${HOME}/.local/bin` is not in your PATH
134-
135-
```
136-
PATH=$PATH:${HOME}/.local/bin
137-
```
138-
139-
test
140-
141-
```
142-
deploy.sh -h
143-
```
144-
14569
### deployment steps
14670

14771
In `docopts` project folder.
14872

149-
So you need to create the release text in `deployment.yml` before you run
150-
`deploy.sh`.
151-
152-
See what will going on (dry-run):
153-
154-
```
155-
deploy.sh deploy -n
156-
```
73+
You need to create the release text in `deployment.yml` first.
15774

158-
Deploy and replace existing binaries for this release.
75+
Dry-run to create release files and binaries in the `dist/` dir:
15976

16077
```
161-
deploy.sh deploy --replace
78+
make snapshot
16279
```
16380

164-
Only build binaries in `build/` dir:
81+
Publish the binaries and release notes:
16582

16683
```
167-
deploy.sh build
84+
make release
16885
```

Diff for: docs/release.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,10 @@ git tag
8282
8383
## 9. build the release
8484
85-
With [deploy.sh](https://github.com/opensource-expert/deploy.sh) installed in our PATH
86-
Note: `deploy.sh` use `docopts` and `docopts.sh` in the PATH
87-
8885
The following will build all binary version from `deployment.yml`
8986
9087
```
91-
deploy.sh build
88+
make snapshot
9289
```
9390
9491
## 10. push the tag on docopts
@@ -99,11 +96,7 @@ git push docopts $(cat ./VERSION)
9996
10097
## 11. deploy the release
10198
102-
load github env
103-
10499
```
105-
. ./env
106-
export GITHUB_USER=docopt
107-
export GITHUB_REPO=docopts
108-
deploy.sh deploy
100+
export GITHUB_TOKEN="your token here"
101+
make release
109102
```

0 commit comments

Comments
 (0)