Skip to content

Commit

Permalink
add github workflow for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
youyupei committed Aug 3, 2023
1 parent 3ffb0aa commit 184348d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Python distributions to PyPI and TestPyPI
on:
push:
tags:
- 'v*' # Trigger the workflow when a new tag starting with 'v' is pushed

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: >-
cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311
build-requirements: 'cython'

- name: Install twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*-manylinux*.whl
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# packages-dir: wheelhouse
# - name: Publish distribution to PyPI
# if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages-dir: wheelhouse
18 changes: 8 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# from distutils.core import setup
# from Cython.Build import cythonize

# setup(
# name="fast_edit_distance",
# version="1.0",
# ext_modules=cythonize("src/fast_edit_distance.pyx"),
# )

from setuptools import setup, find_packages
from Cython.Build import cythonize

with open('README.md', 'r') as f:
long_description = f.read()



setup(
name='fast_edit_distance',
version='1.2.0',
version='1.2.1',
author='Yupei You',
author_email="youyupei@gmail.com",
description='Implementation of edit distance calculation.',
packages=find_packages(),
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/youyupei/fast_edit_distance",
install_requires=['cython'],
classifiers=[
Expand Down

0 comments on commit 184348d

Please sign in to comment.