Skip to content

Commit 3889e2e

Browse files
feat(publish.yml): add publish.yml file
1 parent b6a8aac commit 3889e2e

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: Publish Python 🐍 distributions 📦 to PyPI
10+
11+
on:
12+
release:
13+
types: [ published ]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-22.04
22+
environment: PyPi
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install build
35+
python -m pip install tox
36+
37+
- name: Build Python 🐍 packages
38+
run: python -m build
39+
40+
- name: Publish distribution 📦 to PyPI
41+
# Upload packages only on a tagged commit
42+
if: startsWith(github.ref, 'refs/tags')
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
user: __token__
46+
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)