Skip to content

Commit f87c787

Browse files
committed
FEAT(CI) release to PyPi with secret in GitHubActions
1 parent e72fc1b commit f87c787

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/pypi-upload.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# From https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
2+
name: Publish to PyPi
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.x"
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build
21+
- name: Build package
22+
run: python -m build
23+
- name: Publish package
24+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
25+
with:
26+
# repository-url: https://test.pypi.org/legacy/
27+
user: __token__
28+
password: ${{ secrets.PYPI_API_TOKEN }}
29+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)