Skip to content

Commit eb0092b

Browse files
committed
feat: add publish-to-test-pypi.yml
Signed-off-by: Milad Makdesi <milad@id8-engineering.io>
1 parent 1a8fcb4 commit eb0092b

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: publish-to-test-pypi
2+
3+
on:
4+
push:
5+
branches: ["test_pypi"]
6+
7+
jobs:
8+
build:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
26+
27+
- name: Build distributions with uv
28+
run: uv build
29+
30+
- name: Upload distributions as artifact
31+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.0
32+
with:
33+
name: python-package-distributions
34+
path: dist/
35+
36+
publish-to-test-pypi:
37+
name: Publish Python distribution to TestPyPI
38+
needs: [build]
39+
runs-on: ubuntu-latest
40+
41+
environment:
42+
name: testpypi
43+
url: https://test.pypi.org/p/python-em511
44+
45+
permissions:
46+
id-token: write
47+
48+
steps:
49+
- name: Download built distributions
50+
uses: actions/download-artifact@c850b53ee1b2e2f4c015e8d3a40c12b4e4a7f6f0 # v4.1.8
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
55+
- name: Publish distribution to TestPyPI
56+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
57+
with:
58+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)