Skip to content

Commit d454934

Browse files
committed
Add support for travis-ci to build releases, as well as a script to tag code for which a release should be built
1 parent fb8042f commit d454934

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
language: go
22
go:
3-
- 1.x
3+
- 1.x
4+
deploy:
5+
provider: releases
6+
api_key:
7+
secure: u+ZCN5GoEmN/JcG4rC5ioxoTGZ3wWHF4atS6scevqhv0EbHzfsnmxvX+mx0pGDPIVxfifeGafTkVckT3lbDYMeIAM+qyT4DJuF8R3gHpU9G+3rGCtfuBmKoCGjy+mpAPVLhxDXSvbZV4VSxhs45rS3UgBKo+icM6jSYiJht/8GLQrBLlq7592tSew6jEbaQLGi0UY/JoQX83Th4RzQa9RExTE54AVA6W6pHQP+hY8xi5zKn/PU1gSMqISUTeq1DDebnJX/qMqSZdPx9yT9ddI69SFtdTghDAscXWKIpu31NNZk/1b25sA5ZE5ytvrrlizcZAgCBxZJfMHlfxyl8lO68B5Zd0jH8meD1u561KrrtiuyDHrfBWt6qvUUmo1ztpZky5AoDozbPnS/8BBYELE8q5xyVoBgevYXGlGffRF4HsEsKKTbjuatbMO4Gkhy/apGlgxnZ+qlx2TFdEfOT97OMT12VSeZWqpvYisdFbsKHRdZOax8+UapE8jV7jlKgMZS5Io98jNsmxjHRrqDTgr7VEDfQMhOBIq+pnjj5UqR6BCFFagD5a7hBAZP+PmcbTWpRbTFeO/H8E9hAXy9JPybwRvcZ579s1dJ0DWUzeYHluccwu51tQ+H0lxq/QC7G88v7BLVUFf3HLJz7nlPEjtVT0wkmq33R2oDuE1opul2k=
8+
file: bin/chrome-ssh-agent.zip
9+
skip_cleanup: true
10+
on:
11+
tags: true

release.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash -eu
2+
#
3+
# Copyright 2018 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Usage:
18+
# (1) Update version in manifest.json
19+
# (2) Run release.sh
20+
21+
cd $(dirname $0)
22+
23+
function die() {
24+
echo $1
25+
exit 1
26+
}
27+
28+
# Read current version from manifest.
29+
readonly MANIFEST=${PWD}/manifest.json
30+
readonly VERSION=$(cat "${MANIFEST}" | python -c "import sys, json; print json.load(sys.stdin)['version']")
31+
readonly TAG=v${VERSION}
32+
33+
# Ensure the tag doesn't already exist. This could happen if someone forgot to
34+
# update the version in manifest.json.
35+
test -z $(git tag | grep --line-regexp "${TAG}") \
36+
|| die "Version ${VERSION} already exists"
37+
38+
# Update all vendor packages and ensure everything still builds
39+
# and tests pass.
40+
govendor fetch +vendor
41+
make
42+
43+
# Commit everything. This should include the change to manifest.json and any
44+
# updated vendored packages.
45+
git add .
46+
git commit -m "Bump to version ${VERSION}"
47+
48+
# Tag the release.
49+
git tag -a "${TAG}" -m "Tag version ${VERSION}"
50+
51+
# Push to remote repository, both changes and tags.
52+
git push
53+
git push --tags

0 commit comments

Comments
 (0)