From 960d10da40934ed5467a73686d195fe1ea6ec799 Mon Sep 17 00:00:00 2001 From: jbonzo <8647805+jbonzo@users.noreply.github.com> Date: Mon, 6 Jan 2020 14:23:04 -0500 Subject: [PATCH] Add release to drone --- .drone.yml | 47 ++++++++++++++++++++++++++++++++++++++++++----- README.md | 2 +- setup.py | 12 ++++++++++-- upload | 3 +++ 4 files changed, 56 insertions(+), 8 deletions(-) create mode 100755 upload diff --git a/.drone.yml b/.drone.yml index 6965bfcf..0040f5f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: docker -name: default +name: review platform: os: linux @@ -11,13 +11,50 @@ steps: - name: test image: python:3.7.5-alpine commands: - - pip install -U tox - - tox + - pip install -U tox + - tox trigger: branch: - - master + - master event: - - pull_request + - pull_request + +--- +kind: pipeline +type: docker +name: release + +platform: + os: linux + arch: amd64 + +steps: + - name: build + image: python:3.7.5-alpine + commands: + - python setup.py sdist bdist_wheel + environment: + VERSION: ${DRONE_TAG##v} + + - name: release + image: python:3.7.5 + commands: + - pip install --user --upgrade twine + - ./upload + environment: + PASSWORD: + from_secret: pypi_token + USERNAME: __token__ + +trigger: + event: + - tag + ref: + - refs/tags/v* + +--- +kind: signature +hmac: c5572884fdd2183d7c63100530974a649f4607ee18c813570741d7a63f31cfae ... diff --git a/README.md b/README.md index 939f5e3e..1e93714c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://drone.polygon.io/api/badges/Polygon-io/polygon-client-python/status.svg)](https://drone.polygon.io/Polygon-io/polygon-client-python) +[![Build Status](https://drone.polygon.io/api/badges/polygon-io/client-python/status.svg)](https://drone.polygon.io/polygon-io/client-python) # Polygon Python Client - WebSocket & RESTful APIs diff --git a/setup.py b/setup.py index 5d48c248..2cf078bf 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,20 @@ from setuptools import setup, find_packages +import os +import sys + +version = os.getenv("VERSION") +if not version: + print("no version supplied") + sys.exit(1) + setup( name="polygon-api-client", - version="0.0.1", + version=version, description="Polygon API client", author_email="ricky@polygon.io", - url="https://github.com/Polygon-io/polygon-client-python", + url="https://github.com/Polygon-io/client-python", packages=find_packages(), classifiers=[ "License :: OSI Approved :: MIT License", diff --git a/upload b/upload new file mode 100755 index 00000000..81baf9cf --- /dev/null +++ b/upload @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python -m twine upload --username ${USERNAME} --password ${PASSWORD} dist/*