Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a GitHub action to push releases to PyPI #98

Merged
merged 3 commits into from Jan 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/publish-release.yml
@@ -0,0 +1,26 @@
name: Publish Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Prepare Env
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: python setup.py sdist bdist_wheel
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ lib/*
src/*
!.gitignore
!.gitmodules
!.github
21 changes: 7 additions & 14 deletions setup.py
@@ -1,21 +1,13 @@
'''
Flask-SeaSurf
-------------

An updated cross-site forgery protection extension for Flask.

Links
`````

* `documentation <http://packages.python.org/Flask-SeaSurf>`_
'''
import os

from setuptools import setup

module_path = os.path.join(os.path.dirname(__file__), 'flask_seasurf.py')
this_directory = os.path.dirname(__file__)
module_path = os.path.join(this_directory, 'flask_seasurf.py')
version_line = [line for line in open(module_path)
if line.startswith('__version_info__')][0]
with open(os.path.join(this_directory, 'README.markdown')) as f:
long_description = f.read()

__version__ = '.'.join(eval(version_line.split('__version_info__ = ')[-1]))

Expand All @@ -27,7 +19,8 @@
author='Max Countryman',
author_email='maxc@me.com',
description='An updated CSRF extension for Flask.',
long_description=__doc__,
long_description=long_description,
long_description_content_type='text/markdown',
py_modules=['flask_seasurf'],
test_suite='test_seasurf',
zip_safe=False,
Expand All @@ -40,7 +33,7 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python 3'
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
Expand Down