Skip to content

Commit abf481c

Browse files
committed
added workflow
1 parent b1898af commit abf481c

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/workflow.yml

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

0 commit comments

Comments
 (0)