Skip to content

Commit 048e14b

Browse files
- Changed publish.yml
1 parent 9d5475a commit 048e14b

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI
1+
name: Upload Python Package to PyPI when a Release is Created
22

33
on:
44
release:
55
types: [created]
66

77
jobs:
8-
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI
8+
pypi-publish:
9+
name: Publish release to PyPI
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/tagbit
14+
permissions:
15+
id-token: write
1116
steps:
12-
- uses: actions/checkout@v2
13-
14-
- name: Set up Python
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: 3.12
18-
19-
- name: Install pip
20-
run: python -m pip install --upgrade pip
21-
22-
- name: Install dependencies
23-
run: pip install -r requirements.txt
24-
25-
- name: Install build
26-
run: python -m pip install build
27-
28-
- name: Build a binary wheel and a source tarball
29-
run: python -m build --sdist --wheel --outdir dist/
30-
31-
- name: Publish distribution 📦 to PyPI
32-
uses: pypa/gh-action-pypi-publish@release/v1
33-
with:
34-
user: __token__
35-
password: ${{ secrets.PYPI_API_TOKEN }}
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

0 commit comments

Comments
 (0)