Skip to content

Commit 5cbcaef

Browse files
committed
Use dedicated GH action to publish to PyPI
1 parent 51e62ed commit 5cbcaef

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.github/workflows/python-package.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@ jobs:
3737
name: Publish package to PyPI
3838
if: startsWith(github.ref, 'refs/tags')
3939
runs-on: ubuntu-latest
40+
environment:
41+
name: pypi
42+
url: https://pypy.org/p/kafka-schema-registry
43+
permissions:
44+
id-token: write
4045
needs: test
4146
steps:
4247
- uses: actions/checkout@v2
4348

4449
- uses: actions/setup-python@v2
4550

46-
- name: Publish package to PyPI
47-
run: make release
48-
env:
49-
TWINE_USERNAME: __token__
50-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
51+
- name: Build files to upload to PyPI
52+
run: make build_dist
53+
- name: Publish package distributions to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ test: $(VENV)
4242
lint: $(VENV)
4343
$(BIN)/flake8
4444

45-
.PHONY: release
46-
release: $(VENV)
45+
.PHONY: build_dist
46+
build_dist: $(VENV)
4747
rm -rf dist
4848
$(BIN)/python setup.py sdist bdist_wheel
49-
$(BIN)/twine upload dist/*
5049

5150
.PHONY: clean
5251
clean:

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ pytest==8.3.4
22
pytest-cov==6.0.0
33
flake8==7.1.1
44
responses==0.25.3
5-
twine==6.0.1
65
wheel==0.45.1
76

0 commit comments

Comments
 (0)