Skip to content

Commit eece48e

Browse files
author
Irsyad
committed
Add PyPI trusted-publisher release workflow
1 parent f5ab88a commit eece48e

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
19+
- name: Build sdist and wheel
20+
run: |
21+
python -m pip install --upgrade build
22+
python -m build
23+
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: dist
27+
path: dist/
28+
29+
publish:
30+
name: Publish to PyPI
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/p/codebread
36+
permissions:
37+
id-token: write
38+
steps:
39+
- uses: actions/download-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
44+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)