Skip to content

Commit c75f7ab

Browse files
authored
Merge pull request #101 from travis-ci/meat-release-prep
Prepare for release
2 parents b56eeef + f0818b9 commit c75f7ab

File tree

4 files changed

+50
-21
lines changed

4 files changed

+50
-21
lines changed

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ env:
1515
- GO_BOOTSTRAP_VERSION=1.7.5
1616
- GOPATH="${HOME}/gopath"
1717
- PATH="${HOME}/bin:${PATH}"
18-
- SHELLCHECK_URL="https://s3.amazonaws.com/travis-blue-public/binaries/ubuntu/14.04/x86_64/shellcheck-0.4.4.tar.bz2"
19-
- SHFMT_URL="https://github.com/mvdan/sh/releases/download/v1.0.0/shfmt_v1.0.0_linux_amd64"
18+
- SHELLCHECK_URL="https://s3.amazonaws.com/travis-blue-public/binaries/ubuntu/14.04/x86_64/shellcheck-0.4.6.tar.bz2"
19+
- SHFMT_URL="https://github.com/mvdan/sh/releases/download/v1.3.1/shfmt_v1.3.1_linux_amd64"
2020
matrix:
2121
- TARGET=native GO_VERSIONS="$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) $(sed -n -e '/^[^#]/p' < .testdata/source-$UNAME)"
2222
- TARGET=arm GO_VERSIONS="master"
@@ -34,9 +34,10 @@ script:
3434
curl -sSL "${SHELLCHECK_URL}" | tar -C "${HOME}/bin" -xjf -;
3535
shellcheck --version;
3636
fi
37-
- if ! command -v shfmt ; then
38-
curl -sSL "${SHFMT_URL}" -o "${HOME}/bin/shfmt" ;
39-
chmod +x "${HOME}/bin/shfmt" ;
37+
- if [ $UNAME = linux ] && [[ $(shfmt -version 2>/dev/null) != v1.3.1 ]] ; then
38+
curl -sSL "${SHFMT_URL}" -o "${HOME}/bin/shfmt";
39+
chmod +x "${HOME}/bin/shfmt";
40+
shfmt -version;
4041
fi
4142
- if [ $UNAME = linux ]; then make lint; fi
4243
- git diff --exit-code

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [Unreleased]
6+
7+
### Added
8+
9+
### Changed
10+
11+
### Deprecated
12+
13+
### Removed
14+
15+
### Fixed
16+
17+
### Security
18+
19+
## [1.2.0] - 2017-07-09
20+
21+
### Added
22+
- support for `stable` alias which auto-updates to point at latest release
23+
- flag/command `-k|--known|known` to list known go versions
24+
25+
### Fixed
26+
- always set `GOROOT` when installing official binaries
27+
528
## [1.1.0] - 2016-12-07
629
### Added
730
- Windows binary downloads
@@ -80,7 +103,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
80103
### Added
81104
- Initial release!
82105

83-
[Unreleased]: https://github.com/travis-ci/gimme/compare/v1.1.0...HEAD
106+
[Unreleased]: https://github.com/travis-ci/gimme/compare/v1.2.0...HEAD
107+
[1.2.0]: https://github.com/travis-ci/gimme/compare/v1.1.0...v1.2.0
84108
[1.1.0]: https://github.com/travis-ci/gimme/compare/v1.0.4...v1.1.0
85109
[1.0.0]: https://github.com/travis-ci/gimme/compare/v0.2.4...v1.0.0
86110
[0.2.4]: https://github.com/travis-ci/gimme/compare/v0.2.3...v0.2.4

gimme

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ set -o pipefail
4949

5050
[[ ${GIMME_DEBUG} ]] && set -x
5151

52-
GIMME_VERSION="v1.1.0"
52+
GIMME_VERSION="v1.2.0"
5353
GIMME_COPYRIGHT="Copyright (c) 2016 Dan Buch, Tianon Gravi, Travis CI GmbH"
54-
GIMME_LICENSE_URL="https://raw.githubusercontent.com/travis-ci/gimme/v1.1.0/LICENSE"
54+
GIMME_LICENSE_URL="https://raw.githubusercontent.com/travis-ci/gimme/v1.2.0/LICENSE"
5555
export GIMME_VERSION
5656
export GIMME_COPYRIGHT
5757
export GIMME_LICENSE_URL
@@ -101,7 +101,7 @@ _binary() {
101101
urls=(
102102
"${GIMME_DOWNLOAD_BASE}/go${version}.${GIMME_OS}-${arch}.tar.gz"
103103
)
104-
if [[ "${GIMME_OS}" = 'darwin' && "${GIMME_BINARY_OSX}" ]]; then
104+
if [[ "${GIMME_OS}" == 'darwin' && "${GIMME_BINARY_OSX}" ]]; then
105105
urls=(
106106
"${GIMME_DOWNLOAD_BASE}/go${version}.${GIMME_OS}-${arch}-${GIMME_BINARY_OSX}.tar.gz"
107107
"${urls[@]}"
@@ -155,8 +155,8 @@ _checkout() {
155155
git reset -q --hard "origin/${1}" \
156156
|| git reset -q --hard "origin/go${1}" \
157157
|| { [ "${1}" = 'tip' ] && git reset -q --hard origin/master; } \
158-
|| git reset -q --hard "refs/tags/${1}" \
159-
|| git reset -q --hard "refs/tags/go${1}"
158+
|| git reset -q --hard "refs/tags/${1}" \
159+
|| git reset -q --hard "refs/tags/go${1}"
160160
} 2>/dev/null)
161161
}
162162

@@ -253,12 +253,12 @@ _env() {
253253
# Tools like `gimme` are the reason that GOROOT-in-env exists.
254254

255255
echo
256-
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTOS)" = "${GIMME_OS}" ]]; then
256+
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTOS)" == "${GIMME_OS}" ]]; then
257257
echo 'unset GOOS;'
258258
else
259259
echo 'export GOOS="'"${GIMME_OS}"'";'
260260
fi
261-
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTARCH)" = "${GIMME_ARCH}" ]]; then
261+
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTARCH)" == "${GIMME_ARCH}" ]]; then
262262
echo 'unset GOARCH;'
263263
else
264264
echo 'export GOARCH="'"${GIMME_ARCH}"'";'
@@ -281,7 +281,7 @@ _env_alias() {
281281
return
282282
fi
283283

284-
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTOS)" = "${GIMME_OS}" && "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTARCH)" = "${GIMME_ARCH}" ]]; then
284+
if [[ "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTOS)" == "${GIMME_OS}" && "$(GOROOT="${1}" "${1}/bin/go" env GOHOSTARCH)" == "${GIMME_ARCH}" ]]; then
285285
local dest="${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.env"
286286
cp "${2}" "${dest}"
287287
ln -sf "${dest}" "${GIMME_ENV_PREFIX}/latest.env"
@@ -390,7 +390,7 @@ _list_versions() {
390390
local cleaned="${d##*/go}"
391391
cleaned="${cleaned%%.${GIMME_OS}.*}"
392392
echo -en "${cleaned}"
393-
if [[ "${cleaned}" = "${current_version}" ]]; then
393+
if [[ "${cleaned}" == "${current_version}" ]]; then
394394
echo -en ' <= current' >&2
395395
fi
396396
echo
@@ -423,8 +423,12 @@ _realpath() {
423423

424424
_get_curr_stable() {
425425
local stable="${GIMME_VERSION_PREFIX}/stable"
426+
local now_secs
427+
now_secs="$(date +%s)"
428+
local stable_age
429+
stable_age="$(_stat_unix "${stable}" 2>/dev/null || echo 0)"
426430
local age
427-
age=$(($(date +%s) - $(_stat_unix "${stable}" 2>/dev/null || echo 0)))
431+
age=$((now_secs - stable_age))
428432

429433
if [[ "${age}" -gt 86400 ]]; then
430434
_update_stable "${stable}"
@@ -610,7 +614,7 @@ case "${GIMME_ARCH}" in
610614
echo >&2 "try go1.5 or newer"
611615
exit 1
612616
fi
613-
if [[ "${GIMME_HOSTOS}" = "linux" && "${GIMME_HOSTARCH}" != "${GIMME_ARCH}" ]]; then
617+
if [[ "${GIMME_HOSTOS}" == "linux" && "${GIMME_HOSTARCH}" != "${GIMME_ARCH}" ]]; then
614618
: "${GIMME_CC_FOR_TARGET:="aarch64-linux-gnu-gcc"}"
615619
fi
616620
;;

runtests

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _test_native() {
2121
echo "---> eval \$(./gimme ${v})"
2222
(
2323
eval "$(./gimme "${v}")"
24-
[[ "$(go env GOOS)" = "$(go env GOHOSTOS)" && "$(go env GOARCH)" = "$(go env GOHOSTARCH)" ]] || exit 1
24+
[[ "$(go env GOOS)" == "$(go env GOHOSTOS)" && "$(go env GOARCH)" == "$(go env GOHOSTARCH)" ]] || exit 1
2525
) || exit 1
2626
done
2727
}
@@ -31,7 +31,7 @@ _test_arm() {
3131
echo "---> eval \$(GIMME_OS=linux GIMME_ARCH=arm ./gimme ${v})"
3232
(
3333
eval "$(GIMME_OS=linux GIMME_ARCH=arm ./gimme "${v}")"
34-
[[ "$(go env GOOS)" = 'linux' && "$(go env GOARCH)" = 'arm' ]] || exit 1
34+
[[ "$(go env GOOS)" == 'linux' && "$(go env GOARCH)" == 'arm' ]] || exit 1
3535
) || exit 1
3636
done
3737
}
@@ -42,11 +42,11 @@ _test_arm64() {
4242
echo "---> skipping ${v} because it probably won't work o_o"
4343
continue
4444
fi
45-
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then cgo=1; else cgo=0; fi
45+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cgo=1; else cgo=0; fi
4646
echo "---> eval \$(GIMME_OS=linux GIMME_ARCH=arm64 GIMME_CGO_ENABLED=$cgo ./gimme $v)"
4747
(
4848
eval "$(GIMME_OS=linux GIMME_ARCH=arm64 GIMME_CGO_ENABLED=$cgo ./gimme "${v}")"
49-
[[ "$(go env GOOS)" = 'linux' && "$(go env GOARCH)" = 'arm64' ]] || exit 1
49+
[[ "$(go env GOOS)" == 'linux' && "$(go env GOARCH)" == 'arm64' ]] || exit 1
5050
) || exit 1
5151
done
5252
}

0 commit comments

Comments
 (0)