diff --git a/DEV.md b/DEV.md index 8f7491b..25171b4 100644 --- a/DEV.md +++ b/DEV.md @@ -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 ``` @@ -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. diff --git a/Makefile b/Makefile index aa6cb3b..6ca6f58 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index f357afb..3a3f7fd 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. diff --git a/VERSION b/VERSION deleted file mode 100644 index 07650b8..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -x.x.x \ No newline at end of file diff --git a/scripts/build-bin.sh b/scripts/build-bin.sh index fe5c63c..4cc0d3a 100644 --- a/scripts/build-bin.sh +++ b/scripts/build-bin.sh @@ -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} diff --git a/scripts/build-dist.sh b/scripts/build-dist.sh index 0233be4..022925d 100644 --- a/scripts/build-dist.sh +++ b/scripts/build-dist.sh @@ -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} diff --git a/scripts/install-latest-darwin-amd64.sh b/scripts/install-latest-darwin-amd64.sh index feea00a..639802e 100755 --- a/scripts/install-latest-darwin-amd64.sh +++ b/scripts/install-latest-darwin-amd64.sh @@ -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" diff --git a/scripts/update-latest-tag.sh b/scripts/update-latest-tag.sh deleted file mode 100644 index a5ffe1e..0000000 --- a/scripts/update-latest-tag.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -git tag -d latest -git tag -a latest -m "Latest" -git push --force origin --tags