-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GitHub workflow to release version tags to PyPI
- Loading branch information
Showing
3 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish package to PyPI | ||
|
||
# Publishes to PyPI whenever a tag in the format "vX.X.X" is pushed. | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build package and publish to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Install pypa/setuptools | ||
run: >- | ||
python -m | ||
pip install wheel | ||
- name: Get version from tag name | ||
id: tag | ||
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) | ||
- name: Update version in setup.py | ||
run: >- | ||
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py | ||
- name: Build a binary wheel | ||
run: >- | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
#!/usr/bin/env python | ||
from setuptools import find_packages, setup | ||
|
||
VERSION = "1.9.0" | ||
import os | ||
|
||
PACKAGES = find_packages() | ||
REQUIREMENTS = ['django >=2.2,<5.0'] | ||
|
@@ -21,23 +20,25 @@ | |
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10'] | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11'] | ||
|
||
|
||
DESCRIPTION = ( | ||
"A Django app for handling reports from web browsers of violations of your website's " | ||
"HTTP Content Security Policy." | ||
) | ||
LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), "README.md")).read() | ||
|
||
setup( | ||
name='django-csp-reports', | ||
version='%s' % VERSION, | ||
version="{{VERSION_PLACEHOLDER}}", | ||
description=DESCRIPTION, | ||
long_description=DESCRIPTION, | ||
long_description=LONG_DESCRIPTION, | ||
long_description_content_type="text/markdown", | ||
author='Adam Alton', | ||
author_email='[email protected]', | ||
url='https://github.com/adamalton/django-csp-reports', | ||
download_url='https://github.com/adamalton/django-csp-reports/tarball/%s' % VERSION, | ||
packages=PACKAGES, | ||
include_package_data=True, | ||
python_requires='>=3.4', | ||
|