Skip to content

Commit f5cc99e

Browse files
committed
Add publishing on releases
1 parent 1c08826 commit f5cc99e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/pypi-publish.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: publish pypi package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.8
16+
- name: Install pipenv
17+
run: |
18+
python -m pip install --upgrade pip
19+
python -m pip install --upgrade setuptools wheel
20+
python -m pip install --upgrade pipenv
21+
- name: Install dependencies
22+
run: pipenv install --dev
23+
- name: Publish package
24+
run: |
25+
pipenv run pipenv-setup sync
26+
pipenv run python setup.py sdist bdist_wheel
27+
pipenv run twine upload -u __token__ -p ${{secrets.PYPI_PUBLISH_TOKEN}} dist/*
28+
env:
29+
PACKAGE_VERSION_TO_PUBLISH: ${{ github.event.release.name }}

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# coding: utf-8
2+
import os
23

34
from setuptools import setup, find_packages
45

@@ -7,7 +8,7 @@
78

89
setup(
910
name="regula.documentreader.webclient",
10-
version="5.2.0-beta.0",
11+
version=os.getenv("PACKAGE_VERSION_TO_PUBLISH", "5.2.0-beta.0"),
1112
python_requires=">=3.5",
1213
description="Regula's Document Reader python client",
1314
long_description=long_description,
@@ -30,5 +31,5 @@
3031
"urllib3==1.25.10",
3132
],
3233
packages=find_packages(exclude=["test", "tests", "example"]),
33-
include_package_data=True
34+
include_package_data=True,
3435
)

0 commit comments

Comments
 (0)