Skip to content

Commit 70b288f

Browse files
authored
Auto-attach plugin on release. (#100)
1 parent 4ea8bda commit 70b288f

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

.circleci/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,24 @@ jobs:
5555
- run: ./ci/setup_build_environment.sh
5656
- run: ./ci/install_bazel.sh
5757
- run: ./ci/do_ci.sh bazel.build
58+
release:
59+
docker:
60+
- image: ubuntu:17.10
61+
steps:
62+
- checkout
63+
- run: ./ci/setup_build_environment.sh
64+
- run: ./ci/do_ci.sh release
5865

5966
workflows:
6067
version: 2
6168
build_test_and_deploy:
6269
jobs:
70+
- release:
71+
filters:
72+
branches:
73+
ignore: /.*/
74+
tags:
75+
only: /^v[0-9]+(\.[0-9]+)*$/
6376
- asan
6477
- tsan
6578
- build_with_no_grpc

ci/do_ci.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ elif [[ "$1" == "cmake.tsan" ]]; then
4646
exit 0
4747
elif [[ "$1" == "plugin" ]]; then
4848
cd "${BUILD_DIR}"
49-
"${SRC_DIR}"/ci//build_plugin.sh
49+
"${SRC_DIR}"/ci/build_plugin.sh
5050
exit 0
5151
elif [[ "$1" == "bazel.build" ]]; then
5252
bazel build //...
5353
exit 0
54+
elif [[ "$1" == "release" ]]; then
55+
"${SRC_DIR}"/ci/build_plugin.sh
56+
"${SRC_DIR}"/ci/release.sh
57+
exit 0
5458
fi

ci/release.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
set -e
4+
apt-get update
5+
apt-get install --no-install-recommends --no-install-suggests -y \
6+
wget \
7+
unzip
8+
9+
# Install ghr
10+
cd /
11+
wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip
12+
unzip ghr_v0.5.4_linux_amd64.zip
13+
14+
# Create packaged plugins
15+
gzip -c /liblightstep_tracer_plugin.so > /linux-amd64-liblightstep_tracer_plugin.so.gz
16+
17+
# Create release
18+
cd "${SRC_DIR}"
19+
VERSION_TAG="`git describe --abbrev=0 --tags`"
20+
21+
RELEASE_TITLE="${VERSION_TAG/v/Release }"
22+
# No way to set title see https://github.com/tcnksm/ghr/issues/77
23+
24+
echo "/ghr -t <hidden> \
25+
-u $CIRCLE_PROJECT_USERNAME \
26+
-r $CIRCLE_PROJECT_REPONAME \
27+
-replace \
28+
"${VERSION_TAG}" \
29+
/linux-amd64-liblightstep_tracer_plugin.so.gz"
30+
/ghr -t $GITHUB_TOKEN \
31+
-u $CIRCLE_PROJECT_USERNAME \
32+
-r $CIRCLE_PROJECT_REPONAME \
33+
-replace \
34+
"${VERSION_TAG}" \
35+
/linux-amd64-liblightstep_tracer_plugin.so.gz

ci/setup_build_environment.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ apt-get install --no-install-recommends --no-install-suggests -y \
1111
automake \
1212
autogen \
1313
autoconf \
14-
libtool
14+
libtool \
15+
ssh

0 commit comments

Comments
 (0)