Skip to content

Commit

Permalink
Use dedicated GH action to publish to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopofar committed Dec 17, 2024
1 parent 51e62ed commit 5cbcaef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ jobs:
name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypy.org/p/kafka-schema-registry
permissions:
id-token: write
needs: test
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Publish package to PyPI
run: make release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Build files to upload to PyPI
run: make build_dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ test: $(VENV)
lint: $(VENV)
$(BIN)/flake8

.PHONY: release
release: $(VENV)
.PHONY: build_dist
build_dist: $(VENV)
rm -rf dist
$(BIN)/python setup.py sdist bdist_wheel
$(BIN)/twine upload dist/*

.PHONY: clean
clean:
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ pytest==8.3.4
pytest-cov==6.0.0
flake8==7.1.1
responses==0.25.3
twine==6.0.1
wheel==0.45.1

0 comments on commit 5cbcaef

Please sign in to comment.