Skip to content

Commit a854c17

Browse files
committed
Add test publish
1 parent b5e0d10 commit a854c17

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
run: |
3131
python -m twine upload dist/*
3232
env:
33-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
33+
TWINE_USERNAME: __token__
3434
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/test-publish.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test Publish to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_suffix:
7+
description: 'Version suffix for test release (e.g., .dev1, .rc1)'
8+
required: false
9+
default: '.dev1'
10+
type: string
11+
12+
jobs:
13+
test-publish:
14+
runs-on: ubuntu-latest
15+
environment: test-pypi
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.11"
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v3
28+
29+
- name: Install build dependencies
30+
run: |
31+
uv sync --extra dev
32+
33+
- name: Build package
34+
run: |
35+
uv build
36+
37+
- name: Check package
38+
run: |
39+
uvx twine check dist/*
40+
41+
- name: List built packages
42+
run: |
43+
ls -la dist/
44+
45+
- name: Publish to TestPyPI
46+
env:
47+
TWINE_USERNAME: __token__
48+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
49+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
50+
run: |
51+
uvx twine upload dist/* --verbose
52+
53+
- name: Test installation from TestPyPI
54+
run: |
55+
sleep 30 # Wait for package to be available
56+
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ temp-mail-io
57+
python -c "import tempmail; print('✓ Package installed successfully from TestPyPI')"
58+
python -c "from tempmail import TempMailClient; print('✓ TempMailClient imports successfully')"

0 commit comments

Comments
 (0)