Skip to content

Commit

Permalink
Merge pull request #22 from matthewfeickert/ci/add-gha-for-publishing
Browse files Browse the repository at this point in the history
ci: Update publishing workflow and add checks
  • Loading branch information
tmaeno authored Nov 17, 2021
2 parents f84712b + 356e2ff commit 9fad471
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
43 changes: 32 additions & 11 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
name: Upload Python Package

on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [created]
types: [published]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
python -m pip install --upgrade pip setuptools wheel
python -m pip install build twine
python -m pip list
- name: Build a sdist
run: |
python setup.py sdist
twine upload dist/*
python -m build --sdist .
- name: Verify the distribution
run: twine check dist/*

- name: List contents of sdist
run: python -m tarfile --list dist/panda-client-*.tar.gz

- name: Publish distribution to PyPI
if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'PanDAWMS/panda-client'
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ packager = Panda Team <[email protected]>
build_requires = python-devel
requires = python

[bdist_wheel]
universal=1

[install]
record = install_record.txt
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,32 @@ def run (self):
except Exception:
pass

with open('README.md', 'r', encoding='utf-8') as description_file:
long_description = description_file.read()

setup(
name="panda-client",
version=release_version,
description=' PanDA Client Package',
long_description='''This package contains PanDA Client Tools''',
description='PanDA Client Package',
long_description=long_description,
long_description_content_type='text/markdown',
license='GPL',
author='PanDA Team',
author_email='[email protected]',
url='https://panda-wms.readthedocs.io/en/latest/',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],

# optional pip dependencies
extras_require={
Expand Down

0 comments on commit 9fad471

Please sign in to comment.