Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish distributions to TestPyPI

on:
workflow_dispatch:
push:
tags:
- "v*-testpypi"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build tools
run: python -m pip install --upgrade build twine

- name: Build distributions
run: python -m build

- name: Check distributions
run: twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: testpypi-dist
path: dist/
retention-days: 1

publish-testpypi:
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/zarr
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: testpypi-dist
path: dist

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
repository-url: https://test.pypi.org/legacy/

test-install:
needs: publish-testpypi
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Wait for TestPyPI package
run: sleep 30

- name: Install from TestPyPI
run: |
pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
zarr

- name: Test import
run: python -c "import zarr; print(zarr.__version__)"
1 change: 1 addition & 0 deletions changes/3798.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add GitHub Actions workflow to test distributions on TestPyPI before release