Skip to content

Commit 3850005

Browse files
authored
Update publish.yml
1 parent d92c3ad commit 3850005

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

.github/workflows/publish.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
name: Upload Python Package to PyPI when a Release is Created
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+
4+
name: Upload Python Package
25

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

710
jobs:
8-
pypi-publish:
9-
name: Publish release to PyPI
11+
deploy:
12+
1013
runs-on: ubuntu-latest
11-
environment:
12-
name: pypi
13-
url: https://pypi.org/p/Better-MD
14-
permissions:
15-
id-token: write
14+
1615
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: "3.x"
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install setuptools wheel
26-
- name: Build package
27-
run: |
28-
python setup.py sdist bdist_wheel # Could also be python -m build
29-
- name: Publish package distributions to PyPI
30-
uses: pypa/gh-action-pypi-publish@release/v1
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*

0 commit comments

Comments
 (0)