Skip to content

Commit d7838ae

Browse files
authored
Update python-publish.yml
1 parent e82c28b commit d7838ae

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed
Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Upload Python Package
1+
name: Publish Python Package
102

113
on:
124
release:
@@ -16,27 +8,30 @@ permissions:
168
contents: read
179

1810
jobs:
19-
deploy:
20-
11+
publish:
2112
runs-on: ubuntu-latest
22-
2313
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python
26-
uses: actions/setup-python@v3
27-
with:
28-
python-version: '3.x'
29-
- name: Install dependencies
30-
run: |
31-
cd PyPI/Package
32-
python -m pip install --upgrade pip
33-
pip install build
34-
- name: Build package
35-
run: |
36-
cd PyPI/Package
37-
python -m build
38-
- name: Publish package
39-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
40-
with:
41-
user: __token__
42-
password: ${{ secrets.PYPI_API_TOKEN }}
14+
- name: Check out repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build twine
26+
working-directory: /PyPI/Package
27+
28+
- name: Build package
29+
run: python -m build
30+
working-directory: /PyPI/Package
31+
32+
- name: Publish package to PyPI
33+
run: python -m twine upload dist/*
34+
working-directory: /PyPI/Package
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)