diff --git a/.github/workflows/pypi.publish.yml b/.github/workflows/pypi.publish.yml new file mode 100644 index 0000000..3981a95 --- /dev/null +++ b/.github/workflows/pypi.publish.yml @@ -0,0 +1,55 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +name: Upload Python Package + +# on: +# release: +# types: [published] +on: push + +permissions: + contents: read + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish Python distribution to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/carrot-transform + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index ed05089..31bc0f0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,3 @@ build *.env temp .python-version -workflows diff --git a/pyproject.toml b/pyproject.toml index e175968..982a698 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools", "setuptools-scm"] build-backend = "setuptools.build_meta" [project] -name = "carrottransform" +name = "carrot-transform" version = "0.3.1" authors = [ { name="PD Appleby", email="pdappleby@gmail.com" },