Skip to content

Commit

Permalink
Work out release practice with semantic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
flowrean committed Sep 1, 2020
1 parent a16a38e commit 967a2d9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 18 deletions.
9 changes: 5 additions & 4 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ When developing, you can build a local version of the `gocsv` binary via running

To release an update to `gocsv`, make sure you have committed and pushed the most recent commit on master. Then:

1. Tag the latest commit as "latest".
1. Tag the latest commit following [semantic versioning](https://semver.org) and push the tag.

```shell
make tag
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3
```


Expand All @@ -27,6 +28,6 @@ To release an update to `gocsv`, make sure you have committed and pushed the mos
make dist
```

This will create zip files in the `dist` directory holding the `gocsv` binaries for various platforms and architectures.
This will create zip files in the `dist` directory holding the `gocsv` binaries for various platforms and architectures. The version to be returned by `gocsv version` is derived from the Git tag, so make sure to only run this after having carried out step 1.

3. Upload the newly created distribution binaries to the [Latest Release](https://github.com/aotimme/gocsv/releases/tag/latest) page. You will need to [edit](https://github.com/aotimme/gocsv/releases/edit/latest) the release, remove the existing zip files, and upload the recently created zip files in `dist/`.
3. Navigate to the [Releases page](https://github.com/aotimme/gocsv/releases) and draft a new release. Upload the newly created distribution binaries (zip files in `dist/`) by dropping them on the page.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ EXECUTABLE=gocsv
dist:
bash scripts/build-dist.sh

tag:
bash scripts/update-latest-tag.sh

test:
cd $(CMD_DIR) && GO111MODULE=on go test -cover
cd $(CSV_DIR) && GO111MODULE=on go test -cover
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ To enable debugging mode when running a `gocsv` command, specify the `--debug` c
## Installation
For the latest pre-built binaries, cross-compiled using [xgo](https://github.com/karalabe/xgo), see the [Latest Release](https://github.com/aotimme/gocsv/releases/tag/latest) page.
For the latest pre-built binaries, cross-compiled using [xgo](https://github.com/karalabe/xgo), see the [Latest Release](https://github.com/aotimme/gocsv/releases/latest) page.
### Apple OS X
Expand All @@ -747,7 +747,7 @@ For the latest pre-built binaries, cross-compiled using [xgo](https://github.com
Open a Terminal window and paste the following command:
```shell
/bin/bash <(curl -s https://raw.githubusercontent.com/aotimme/gocsv/latest/scripts/install-latest-darwin-amd64.sh)
/bin/bash <(curl -s https://raw.githubusercontent.com/aotimme/gocsv/master/scripts/install-latest-darwin-amd64.sh)
```
This will install `gocsv` at `/usr/local/bin/gocsv`.
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/build-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BIN_DIR=$(pwd)/bin
EXECUTABLE=gocsv

GIT_HASH=$(git rev-parse HEAD)
VERSION=$(cat VERSION)
VERSION=$(git describe --tags HEAD)
LD_FLAGS="-X github.com/aotimme/gocsv/cmd.VERSION=${VERSION} -X github.com/aotimme/gocsv/cmd.GIT_HASH=${GIT_HASH}"

rm -rf ${BIN_DIR}
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DIST_DIR=$(pwd)/dist
EXECUTABLE=gocsv

GIT_HASH=$(git rev-parse HEAD)
VERSION=$(cat VERSION)
VERSION=$(git describe --tags HEAD)
LD_FLAGS="-X github.com/aotimme/gocsv/cmd.VERSION=${VERSION} -X github.com/aotimme/gocsv/cmd.GIT_HASH=${GIT_HASH}"

rm -rf ${BUILD_DIR}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-latest-darwin-amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BINARY_DIRNAME="gocsv-darwin-10.6-amd64"
ZIP_FILENAME="${BINARY_DIRNAME}.zip"
ZIP_URL="https://github.com/aotimme/gocsv/releases/download/latest/${ZIP_FILENAME}"
ZIP_URL="https://github.com/aotimme/gocsv/releases/latest/download/${ZIP_FILENAME}"
TMP_DIR=$(mktemp -d)
INSTALL_DIR="/usr/local/bin"
INSTALL_LOCATION="${INSTALL_DIR}/gocsv"
Expand Down
5 changes: 0 additions & 5 deletions scripts/update-latest-tag.sh

This file was deleted.

0 comments on commit 967a2d9

Please sign in to comment.