Skip to content

Commit

Permalink
Merge pull request #115 from travis-ci/meat-release-prep
Browse files Browse the repository at this point in the history
Prep for v1.3.0 release
  • Loading branch information
meatballhat committed Jan 19, 2018
2 parents 79633d4 + 4ce33c3 commit bd5d9fb
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .testdata/binary-darwin
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@
1.3.1
1.3
1.2.2
1.10beta2
1.10beta1
2 changes: 2 additions & 0 deletions .testdata/binary-linux
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@
1.3.1
1.3
1.2.2
1.10beta2
1.10beta1
1 change: 0 additions & 1 deletion .testdata/stubheader-sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
# Instead we include:
# * all versions of the current release series
# * the last formal release in all previous series
# * at least one beta and rc

#
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ sudo: false
dist: trusty
os:
- linux
- osx
# Disabling, potentially permanently, given ongoing sadness :crying_cat_face:
# - osx
cache:
directories:
- "${HOME}/bin"
osx_image: xcode7.3
# Disabling, potentially permanently, given ongoing sadness :crying_cat_face:
# osx_image: xcode7.3
env:
global:
- GIMME_TMP="${TRAVIS_BUILD_DIR}/tmp"
- UNAME="$(uname | tr '[:upper:]' '[:lower:]')"
- GO_BOOTSTRAP_VERSION=1.8.3
- GOPATH="${HOME}/gopath"
- PATH="${HOME}/bin:${PATH}"
- SHELLCHECK_URL="https://s3.amazonaws.com/travis-blue-public/binaries/ubuntu/14.04/x86_64/shellcheck-0.4.6.tar.bz2"
- SHFMT_URL="https://github.com/mvdan/sh/releases/download/v1.3.1/shfmt_v1.3.1_linux_amd64"
- SHELLCHECK_URL="https://www.googleapis.com/download/storage/v1/b/shellcheck/o/shellcheck-v0.4.7.linux.x86_64.tar.xz?alt=media"
- SHFMT_URL="https://github.com/mvdan/sh/releases/download/v2.2.0/shfmt_v2.2.0_linux_amd64"
matrix:
- TARGET=native GO_VERSIONS="$(sed -n -e '/^[^#]/p' < .testdata/sample-binary-$UNAME) $(sed -n -e '/^[^#]/p' < .testdata/source-$UNAME)"
- TARGET=arm GO_VERSIONS="master"
Expand All @@ -30,11 +32,12 @@ addons:
before_script:
- mkdir -p "${GIMME_TMP}"
script:
- if [ $UNAME = linux ] && ! shellcheck --version; then
curl -sSL "${SHELLCHECK_URL}" | tar -C "${HOME}/bin" -xjf -;
- if [ $UNAME = linux ] && [[ $(shellcheck --version | awk '/^version:/ { print $2 }') != 0.4.7 ]] ; then
curl -sSL -o "${GIMME_TMP}/shellcheck.tar.xz" "${SHELLCHECK_URL}";
tar -C "${HOME}/bin" --exclude="*.txt" --strip-components=1 -xf "${GIMME_TMP}/shellcheck.tar.xz";
shellcheck --version;
fi
- if [ $UNAME = linux ] && [[ $(shfmt -version 2>/dev/null) != v1.3.1 ]] ; then
- if [ $UNAME = linux ] && [[ $(shfmt -version 2>/dev/null) != v2.2.0 ]] ; then
curl -sSL "${SHFMT_URL}" -o "${HOME}/bin/shfmt";
chmod +x "${HOME}/bin/shfmt";
shfmt -version;
Expand Down
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added

- Code of Conduct

### Changed

- `1.8` and `1.9` are now build-from-source bootstrapping candidates

### Deprecated

### Removed
Expand All @@ -20,6 +16,20 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Security

## [1.3.0] - 2018-01-17

### Added

- Code of Conduct

### Changed

- `1.8` and `1.9` are now build-from-source bootstrapping candidates

### Fixed
- paginate bucket when fetching 'stable' alias
- account for future 1.1x releases in version regex

## [1.2.0] - 2017-07-09

### Added
Expand Down
181 changes: 92 additions & 89 deletions gimme
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ set -o pipefail

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

GIMME_VERSION="v1.2.0"
GIMME_COPYRIGHT="Copyright (c) 2016 Dan Buch, Tianon Gravi, Travis CI GmbH"
GIMME_LICENSE_URL="https://raw.githubusercontent.com/travis-ci/gimme/v1.2.0/LICENSE"
GIMME_VERSION="v1.3.0"
GIMME_COPYRIGHT="Copyright (c) 2015-2018 Dan Buch, Tianon Gravi, Travis CI GmbH"
GIMME_LICENSE_URL="https://raw.githubusercontent.com/travis-ci/gimme/v1.3.0/LICENSE"
export GIMME_VERSION
export GIMME_COPYRIGHT
export GIMME_LICENSE_URL
Expand Down Expand Up @@ -152,11 +152,11 @@ _fetch() {
_checkout() {
_fetch "${2}"
(cd "${2}" && {
git reset -q --hard "origin/${1}" \
|| git reset -q --hard "origin/go${1}" \
|| { [ "${1}" = 'tip' ] && git reset -q --hard origin/master; } \
|| git reset -q --hard "refs/tags/${1}" \
|| git reset -q --hard "refs/tags/go${1}"
git reset -q --hard "origin/${1}" ||
git reset -q --hard "origin/go${1}" ||
{ [ "${1}" = 'tip' ] && git reset -q --hard origin/master; } ||
git reset -q --hard "refs/tags/${1}" ||
git reset -q --hard "refs/tags/go${1}"
} 2>/dev/null)
}

Expand Down Expand Up @@ -293,18 +293,18 @@ _env_alias() {

_try_existing() {
case "${1}" in
binary)
local existing_ver="${GIMME_VERSION_PREFIX}/go${GIMME_GO_VERSION}.${GIMME_OS}.${GIMME_ARCH}"
local existing_env="${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.${GIMME_OS}.${GIMME_ARCH}.env"
;;
source)
local existing_ver="${GIMME_VERSION_PREFIX}/go${GIMME_GO_VERSION}.src"
local existing_env="${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.src.env"
;;
*)
_try_existing binary || _try_existing source
return $?
;;
binary)
local existing_ver="${GIMME_VERSION_PREFIX}/go${GIMME_GO_VERSION}.${GIMME_OS}.${GIMME_ARCH}"
local existing_env="${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.${GIMME_OS}.${GIMME_ARCH}.env"
;;
source)
local existing_ver="${GIMME_VERSION_PREFIX}/go${GIMME_GO_VERSION}.src"
local existing_env="${GIMME_ENV_PREFIX}/go${GIMME_GO_VERSION}.src.env"
;;
*)
_try_existing binary || _try_existing source
return $?
;;
esac

if [[ -x "${existing_ver}/bin/go" && -s "${existing_env}" ]]; then
Expand Down Expand Up @@ -398,6 +398,7 @@ _list_versions() {
}

_list_known() {
# shellcheck disable=SC1117
local exp="go([[:alnum:]\.]*)\.src.*" # :alnum: catches beta versions too
local list="${GIMME_TMP}/known-versions"

Expand All @@ -408,6 +409,7 @@ _list_known() {

while read -r line; do
if [[ "${line}" =~ ${exp} ]]; then
# shellcheck disable=SC1117
known="$known\n${BASH_REMATCH[1]}"
fi
done <"${list}"
Expand Down Expand Up @@ -451,6 +453,7 @@ _update_stable() {

while nextPageToken=$(jq --exit-status --raw-output '.nextPageToken' <"$tmp_versions"); do
_do_curl "${url}&pageToken=${nextPageToken}" "${tmp_versions}"
# shellcheck disable=SC1117
vers="${vers}\n$(jq -r '.items[].name | capture("go(?<ver>[[:digit:]\\.]*)\\.src.*").ver' <"$tmp_versions")"
done

Expand All @@ -461,12 +464,12 @@ _update_stable() {
_stat_unix() {
local filename="${1}"
case "${GIMME_HOSTOS}" in
darwin | *bsd)
stat -f %a "${filename}"
;;
linux)
stat -c %Y "${filename}"
;;
darwin | *bsd)
stat -f %a "${filename}"
;;
linux)
stat -c %Y "${filename}"
;;
esac
}

Expand Down Expand Up @@ -503,24 +506,24 @@ _exclude_from_backups() {
# Please avoid anything which requires elevated privileges or is obnoxious
# enough to offend the invoker
case "${GIMME_HOSTOS}" in
darwin)
# Darwin: Time Machine is "standard", we can add others. The default
# mechanism is sticky, as an attribute on the dir, requires no
# privileges, is idempotent (and doesn't support -- to end flags).
tmutil addexclusion "$@"
;;
darwin)
# Darwin: Time Machine is "standard", we can add others. The default
# mechanism is sticky, as an attribute on the dir, requires no
# privileges, is idempotent (and doesn't support -- to end flags).
tmutil addexclusion "$@"
;;
esac
}

_versint() {
local args=(${1//[^0-9]/ })
IFS=" " read -r -a args <<<"${1//[^0-9]/ }"
printf '1%03d%03d%03d%03d' "${args[@]}"
}

_to_goarch() {
case "${1}" in
aarch64) echo "arm64" ;;
*) echo "${1}" ;;
aarch64) echo "arm64" ;;
*) echo "${1}" ;;
esac
}

Expand All @@ -539,12 +542,12 @@ _to_goarch() {

# The version prefix must be an absolute path
case "${GIMME_VERSION_PREFIX}" in
/*) true ;;
*)
echo >&2 " Fixing GIMME_VERSION_PREFIX from relative: $GIMME_VERSION_PREFIX"
GIMME_VERSION_PREFIX="$(pwd)/${GIMME_VERSION_PREFIX}"
echo >&2 " to: $GIMME_VERSION_PREFIX"
;;
/*) true ;;
*)
echo >&2 " Fixing GIMME_VERSION_PREFIX from relative: $GIMME_VERSION_PREFIX"
GIMME_VERSION_PREFIX="$(pwd)/${GIMME_VERSION_PREFIX}"
echo >&2 " to: $GIMME_VERSION_PREFIX"
;;
esac

if [[ "${GIMME_OS}" == mingw* ]]; then
Expand All @@ -560,40 +563,40 @@ fi

while [[ $# -gt 0 ]]; do
case "${1}" in
-h | --help | help | wat)
_old_ifs="$IFS"
IFS=';'
awk '/^#\+ / {
-h | --help | help | wat)
_old_ifs="$IFS"
IFS=';'
awk '/^#\+ / {
sub(/^#\+ /, "", $0) ;
sub(/-$/, "", $0) ;
print $0
}' "$0" | while read -r line; do
eval "echo \"$line\""
done
IFS="$_old_ifs"
exit 0
;;
-V | --version | version)
echo "${GIMME_VERSION}"
exit 0
;;
-l | --list | list)
_list_versions
exit 0
;;
-k | --known | known)
_list_known
exit 0
;;
-f | --force | force)
force=1
;;
-i | install)
true # ignore a dummy argument
;;
*)
break
;;
eval "echo \"$line\""
done
IFS="$_old_ifs"
exit 0
;;
-V | --version | version)
echo "${GIMME_VERSION}"
exit 0
;;
-l | --list | list)
_list_versions
exit 0
;;
-k | --known | known)
_list_known
exit 0
;;
-f | --force | force)
force=1
;;
-i | install)
true # ignore a dummy argument
;;
*)
break
;;
esac
shift
done
Expand All @@ -606,26 +609,26 @@ if [[ -n "${2}" ]]; then
fi

case "${GIMME_ARCH}" in
x86_64) GIMME_ARCH=amd64 ;;
x86) GIMME_ARCH=386 ;;
arm64)
if [[ "${GIMME_GO_VERSION}" != master && "$(_versint "${GIMME_GO_VERSION}")" < "$(_versint 1.5)" ]]; then
echo >&2 "error: ${GIMME_ARCH} is not supported by this go version"
echo >&2 "try go1.5 or newer"
exit 1
fi
if [[ "${GIMME_HOSTOS}" == "linux" && "${GIMME_HOSTARCH}" != "${GIMME_ARCH}" ]]; then
: "${GIMME_CC_FOR_TARGET:="aarch64-linux-gnu-gcc"}"
fi
;;
arm*) GIMME_ARCH=arm ;;
x86_64) GIMME_ARCH=amd64 ;;
x86) GIMME_ARCH=386 ;;
arm64)
if [[ "${GIMME_GO_VERSION}" != master && "$(_versint "${GIMME_GO_VERSION}")" < "$(_versint 1.5)" ]]; then
echo >&2 "error: ${GIMME_ARCH} is not supported by this go version"
echo >&2 "try go1.5 or newer"
exit 1
fi
if [[ "${GIMME_HOSTOS}" == "linux" && "${GIMME_HOSTARCH}" != "${GIMME_ARCH}" ]]; then
: "${GIMME_CC_FOR_TARGET:="aarch64-linux-gnu-gcc"}"
fi
;;
arm*) GIMME_ARCH=arm ;;
esac

case "${GIMME_HOSTARCH}" in
x86_64) GIMME_HOSTARCH=amd64 ;;
x86) GIMME_HOSTARCH=386 ;;
arm64) ;;
arm*) GIMME_HOSTARCH=arm ;;
x86_64) GIMME_HOSTARCH=amd64 ;;
x86) GIMME_HOSTARCH=386 ;;
arm64) ;;
arm*) GIMME_HOSTARCH=arm ;;
esac

if [[ "${GIMME_GO_VERSION}" == "stable" ]]; then
Expand Down Expand Up @@ -665,7 +668,7 @@ if ! case "${GIMME_TYPE}" in
echo >&2 " Try 'auto', 'binary', 'source', or 'git'."
exit 1
;;
esac; then
esac; then
echo >&2 "I don't have any idea what to do with '${GIMME_GO_VERSION}'."
echo >&2 " (using type '${GIMME_TYPE}')"
exit 1
Expand Down

0 comments on commit bd5d9fb

Please sign in to comment.