Skip to content

Commit 0a70fd4

Browse files
Add test build action
1 parent e094595 commit 0a70fd4

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)