From 0cfcfab87176f5b73f44a8c1f278eabb23889dce Mon Sep 17 00:00:00 2001 From: Sebastian Raschka Date: Tue, 5 Nov 2024 08:10:39 -0600 Subject: [PATCH] Add PyPI deploy workflow (#1110) --- .github/workflows/publish.yaml | 40 ++++++++++++++++++++++++++++++++++ mlxtend/__init__.py | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000..0b825fe4e --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,40 @@ +# To create a release, create a tag and push it to GitHub: +#git tag -a "v0.0.1-beta" -m "beta version testing" +#git push --tags +# https://dev.to/iamtekson/publish-package-to-pypi-and-release-new-version-using-github-actions-108k +name: Publish MLxtend to PyPI + +on: + push: + tags: + - "v*" +jobs: + build-n-publish: + name: Build and publish to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/mlxtend + permissions: + id-token: write + + steps: + - name: Checkout source + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Build source and wheel distributions + run: | + python -m pip install --upgrade build twine + pip install importlib_metadata==7.2.1 + python -m build + twine check --strict dist/* + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/mlxtend/__init__.py b/mlxtend/__init__.py index 19faabe38..8be818a90 100644 --- a/mlxtend/__init__.py +++ b/mlxtend/__init__.py @@ -4,4 +4,4 @@ # # License: BSD 3 clause -__version__ = "0.23.2dev" +__version__ = "0.23.2"