Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 1f6402e

Browse files
authored
Automate the release process using Circle CI (#107)
1 parent ffd53aa commit 1f6402e

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ jobs:
2727
name: Run tests - compatibility_checker
2828
command: |
2929
nox -f nox.py
30+
- deploy:
31+
name: Push to PyPI (if this is a release tag).
32+
command: scripts/twine_upload.sh
33+
34+
deployment:
35+
tag_build_for_cci2:
36+
tag: /(([a-z]+)_)*([0-9]+)\.([0-9]+)\.([0-9]+)/
37+
commands:
38+
- true

scripts/twine_upload.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2017, OpenCensus Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -ev
16+
17+
# If this is not a CircleCI tag, no-op.
18+
if [[ -z "$CIRCLE_TAG" ]]; then
19+
echo "This is not a release tag. Doing nothing."
20+
exit 0
21+
fi
22+
23+
echo -e "[pypi]" >> ~/.pypirc
24+
echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
25+
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
26+
27+
# Ensure that we have the latest versions of Twine, Wheel, and Setuptools.
28+
python3 -m pip install --upgrade twine wheel setuptools
29+
30+
# Build the distribution and upload.
31+
python3 setup.py bdist_wheel
32+
twine upload dist/*

0 commit comments

Comments
 (0)