diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..206540d --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,41 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish-pip: + runs-on: ubuntu-latest + steps: + - name: Clone and checkout branch + uses: actions/checkout@v1 + + - name: Set up Python version + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Install build and twine + run: pip install -U build twine + + - name: Update setup.cfg + run: | + sed -i " + s/{project_name}/${{ github.event.repository.name }}/g; + s/{project_version}/${{ github.ref_name }}/g; + s/{author}/${{ github.repository_owner }}/g; + s/{description}/${{ github.event.repository.description }}/g + " setup.cfg + + - name: Build package + run: python -m build + + - name: Check binaries + run: twine check dist/* + + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fa708b3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + 'setuptools', + 'wheel' +] +build-backend = 'setuptools.build_meta' \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..82f359a --- /dev/null +++ b/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +name = {project_name} +version = {project_version} +author = {author} +author_email = alberlc@outlook.com +description = {description} +long_description = file: README.rst +url = https://github.com/{author}/{project_name} +project_urls = + Bug Tracker = https://github.com/{author}/{project_name}/issues +classifiers = + Programming Language :: Python :: 3.10 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +packages = find_namespace: +include_package_data = True +python_requires = >=3.10 +install_requires = + flanaapis + flanautils + multibot + plotly + +[options.packages.find] +include = {project_name}* + +[options.package_data] +* = *