Skip to content

Commit 2fcf5c0

Browse files
Merge pull request #2 from datamasque/testpypi
ci: Add pipeline for test PyPI
2 parents 2add408 + 84cd867 commit 2fcf5c0

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release (TestPyPI)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Build sdist and wheel
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up uv
14+
uses: astral-sh/setup-uv@v5
15+
with:
16+
enable-cache: true
17+
18+
- name: Set up Python
19+
run: uv python install 3.12
20+
21+
- name: Show package version
22+
run: |
23+
VERSION="$(uv run python -c 'import tomllib; print(tomllib.loads(open("pyproject.toml","rb").read().decode())["project"]["version"])')"
24+
echo "Publishing version: ${VERSION}"
25+
echo "::notice title=TestPyPI version::${VERSION}"
26+
27+
- name: Build
28+
run: uv build
29+
30+
- name: Validate distributions
31+
run: uvx twine check dist/*
32+
33+
- name: Upload distributions
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dist-testpypi
37+
path: dist/
38+
retention-days: 7
39+
40+
publish:
41+
name: Publish to TestPyPI
42+
needs: build
43+
runs-on: ubuntu-latest
44+
environment:
45+
name: testpypi
46+
url: https://test.pypi.org/p/datamasque-python
47+
permissions:
48+
id-token: write
49+
contents: read
50+
steps:
51+
- name: Download distributions
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: dist-testpypi
55+
path: dist/
56+
57+
- name: Publish to TestPyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1
59+
with:
60+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)