Skip to content

Commit 8326e3a

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

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
18+
with:
19+
python-version: "3.x"
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
23+
24+
- name: Build distributions with uv
25+
run: uv build
26+
27+
- name: Upload distributions as artifact
28+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
29+
with:
30+
name: build-${{ github.run_number }}-${{ matrix.python-version }}
31+
path: dist/
32+
33+
publish-to-test-pypi:
34+
name: Publish Python distribution to TestPyPI
35+
needs: [build]
36+
runs-on: ubuntu-latest
37+
38+
environment:
39+
name: testpypi
40+
url: https://test.pypi.org/p/python-em511
41+
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all build artifacts
47+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
48+
with:
49+
name: build-${{ github.run_number }}-${{ matrix.python-version }}
50+
path: dist/
51+
52+
- name: Publish distribution to TestPyPI
53+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
54+
with:
55+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)