Skip to content

Commit baa07f6

Browse files
author
Laurynas Butkus
committed
Enable github publishing
1 parent 7abf8a9 commit baa07f6

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build distribution 📦
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.x"
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m
21+
pip install
22+
build
23+
--user
24+
- name: Build a binary wheel and a source tarball
25+
run: python3 -m build
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python 🐍 distribution 📦 to PyPI
35+
needs:
36+
- build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/convertapi
41+
permissions:
42+
id-token: write # IMPORTANT: mandatory for trusted publishing
43+
44+
steps:
45+
- name: Download all the dists
46+
uses: actions/download-artifact@v3
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
- name: Publish distribution 📦 to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)