Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
me committed Jan 3, 2018
1 parent c58e5d2 commit a49b9ef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ $ go test ./...

## Release

In order to release a new version, set up github export GITHUB_TOKEN=[YOUR_TOKEN] and do the following steps:
In order to release a new version, set up github export GITHUB_TOKEN=[YOUR_TOKEN]

Ensure your git repo is clean. Then update VERSION (no need to commit it, it will be committed automatically), and run:

```
$ git tag -a vX.X.X -m "[Comment]"
$ git push origin vX.X.X
$ goreleaser
$ ./release.sh
```

## Usage
Expand Down
16 changes: 16 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e
set -x

die() { echo "$*" 1>&2 ; exit 1; }

VERSION=`cat VERSION | tr -d '\n'`
git diff-index --quiet --cached HEAD -- || die "Index dirty, commit first"
go generate
git add VERSION
git add cli/version.go
git commit -m "Version $VERSION"
git tag -a v$VERSION -m "Version $VERSION"
git push origin v$VERSION
goreleaser

0 comments on commit a49b9ef

Please sign in to comment.