Skip to content

Commit 198812c

Browse files
author
Claude Subagent
committed
feat: Add GitHub Actions workflow to test distributions on TestPyPI
- New workflow triggered on testpypi version tags - Builds wheel and sdist - Tests installation on Python 3.11, 3.12, 3.13 - Publishes to TestPyPI with twine check validation
1 parent b6d3ae2 commit 198812c

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/testpypi.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish distributions to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*-testpypi"
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
18+
- name: Install build tools
19+
run: python -m pip install --upgrade build twine
20+
21+
- name: Build distributions
22+
run: python -m build
23+
24+
- name: Check distributions
25+
run: twine check dist/*
26+
27+
- name: Publish to TestPyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
repository-url: https://test.pypi.org/legacy/
31+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
32+
skip_existing: true
33+
34+
test-install:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
python-version: ["3.11", "3.12", "3.13"]
40+
steps:
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Wait for TestPyPI package
46+
run: sleep 30
47+
48+
- name: Install from TestPyPI
49+
run: |
50+
pip install --index-url https://test.pypi.org/simple/ \
51+
--extra-index-url https://pypi.org/simple/ \
52+
zarr
53+
54+
- name: Test import
55+
run: python -c "import zarr; print(zarr.__version__)"

changes/3798.feature.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add GitHub Actions workflow to test distributions on TestPyPI before release

0 commit comments

Comments
 (0)