Skip to content

Commit 707dc9a

Browse files
CI: auto deploy pypi
1 parent 8dd6467 commit 707dc9a

File tree

2 files changed

+17
-28
lines changed

2 files changed

+17
-28
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,22 @@ on:
55
types: [created]
66

77
jobs:
8-
testpypi-publish:
9-
name: Publish release to TestPyPI
8+
publish:
9+
name: Publish PyPI
1010
runs-on: ubuntu-latest
11-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
12-
environment:
13-
name: pypi
14-
url: https://pypi.org/p/wrapper-tls-requests
15-
permissions:
16-
id-token: write # IMPORTANT: mandatory for sigstore
1711
steps:
18-
- name: Publish package to TestPyPI
19-
uses: pypa/gh-action-pypi-publish@release/v1
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v4
2014
with:
21-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
22-
repository-url: https://test.pypi.org/legacy/
23-
24-
pypi-publish:
25-
name: Publish release to PyPI
26-
needs: testpypi-publish
27-
runs-on: ubuntu-latest
28-
environment:
29-
name: pypi
30-
url: https://pypi.org/p/wrapper-tls-requests
31-
permissions:
32-
id-token: write # IMPORTANT: mandatory for sigstore
33-
steps:
34-
- name: Publish package to PyPI
35-
uses: pypa/gh-action-pypi-publish@release/v1
36-
with:
37-
password: ${{ secrets.PYPI_API_TOKEN }}
15+
python-version: '3.9'
16+
- name: Install pypa/build
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: __token__
23+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ publish-test-pypi:
2626
python -m pip install -r requirements-dev.txt
2727
python -m pip install 'twine>=6.0.1'
2828
python setup.py sdist bdist_wheel
29-
twine upload --repository testpypi dist/*
29+
twine upload --repository testpypi --skip-existing dist/*
3030
rm -rf build dist .egg wrapper_tls_requests.egg-info
3131

3232
publish-pypi:

0 commit comments

Comments
 (0)