Skip to content

Commit 5973f2b

Browse files
authored
Merge pull request #3 from bellmann/gh-publish
feat: use releases in github for publishing
2 parents b3f8124 + ac3b3ff commit 5973f2b

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.8
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.8
16+
- name: Install Tools
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Package and Upload
21+
env:
22+
PACKAGE_VERSION: ${{ github.event.release.tag_name }}
23+
TWINE_USERNAME: __token__
24+
TWINE_PASSWORD: ${{ secrets.PYPI }}
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
twine upload dist/*

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: drf-simplepermissions
1+
name: test
22

33
on:
44
push:

drf_simplepermissions/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import os
12
from .permissions import is_demo
23
from .permissions import SimplePermissions
34

45

5-
__version__ = '0.0.4'
6+
__version__ = os.environ.get('PACKAGE_VERSION', '0.0.0'),
67
__all__ = ['SimplePermissions', 'is_demo']

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import os
12
from setuptools import setup
23

34
setup(name='drf-simplepermissions',
4-
version='0.0.4',
5+
version=os.environ.get('PACKAGE_VERSION', '0.0.0'),
56
description='SimplePermissions checks against a list of permissions',
67
url='https://github.com/bellmann/python-drf-simplepermissions',
78
author='Bellmann BV',

0 commit comments

Comments
 (0)