Skip to content

Commit eada10e

Browse files
author
mganisin
authored
Merge pull request 3scale-qe#102 from mganisin/action-release
github action to release to pypi
2 parents 98fafd8 + e5955ce commit eada10e

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: '3.7'
14+
- name: build
15+
run: python setup.py ${GITHUB_REF#refs/tags/v} sdist bdist_wheel
16+
- name: release
17+
uses: pypa/gh-action-pypi-publish@master
18+
with:
19+
password: ${{ secrets.PYPI_API_TOKEN }}

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import io
21
import re
2+
import sys
33

44
from setuptools import find_packages, setup
55

66
with open("README.md", "r") as fh:
77
long_description = fh.read()
88

9-
with io.open('threescale_api/__init__.py', 'rt', encoding='utf8') as f:
10-
VERSION = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
9+
VERSION = sys.argv.pop(1)
10+
assert re.match(r"[0-9]+\.[0-9]+\.[0-9]+", VERSION), "Version definition required as first arg"
1111

1212
requirements = ['requests']
1313

threescale_api/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# flake8: noqa
22
from .client import ThreeScaleClient
3-
4-
__version__ = '0.15.0'

0 commit comments

Comments
 (0)