Skip to content

Commit 1d50608

Browse files
authored
Update python-publish.yml
1 parent 320a283 commit 1d50608

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

.github/workflows/python-publish.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
14
name: Upload Python Package
25

36
on:
47
release:
58
types: [published]
69

7-
permissions:
8-
contents: read
9-
1010
jobs:
1111
deploy:
1212

1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v3
16+
- uses: actions/checkout@v3
1817
- name: Set up Python
19-
uses: actions/setup-python@v3
18+
uses: actions/setup-python@v5
2019
with:
21-
python-version: '3.10'
22-
- name: Navigate to root directory
23-
run: cd $GITHUB_WORKSPACE
20+
python-version: '3.x'
2421
- name: Install dependencies
2522
run: |
2623
python -m pip install --upgrade pip
27-
pip install build
28-
- name: Build package
29-
run: python -m build
30-
- name: Publish package
31-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
32-
with:
33-
user: __token__
34-
password: ${{ secrets.PYPI_API_TOKEN }}
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: mvincig11
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
git fetch --all --tags
31+
python setup.py sdist bdist_wheel
32+
twine upload dist/*

0 commit comments

Comments
 (0)