Skip to content

Commit

Permalink
Create python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jachinlin committed Aug 6, 2020
1 parent 8150414 commit 5c478bd
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python
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 }}
run: |
python setup.py bdist_wheel
twine upload dist/*
21 changes: 19 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@

from setuptools import setup

version = '1.0.1'
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel


class bdist_wheel(_bdist_wheel):

def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False

def get_tag(self):
python, abi, plat = _bdist_wheel.get_tag(self)
# We don't contain any python source
python, abi = 'py2.py3', 'none'
return python, abi, plat


version = '1.0.4'

setup(
name='kindle_maker',
Expand All @@ -28,5 +44,6 @@
'console_scripts': [
'make_mobi=kindle_maker:make_mobi_command',
],
}
},
cmdclass={'bdist_wheel': bdist_wheel}
)

0 comments on commit 5c478bd

Please sign in to comment.