Skip to content
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to PyPI

on:
push:
tags:
# Semver versioning pattern
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

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

- name: Build package
run: python -m build

- name: Publish package to PyPI
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
58 changes: 58 additions & 0 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test Publish to TestPyPI

on:
workflow_dispatch:
inputs:
version_suffix:
description: 'Version suffix for test release (e.g., .dev1, .rc1)'
required: false
default: '.dev1'
type: string

jobs:
test-publish:
runs-on: ubuntu-latest
environment: test-pypi

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install build dependencies
run: |
uv sync --extra dev

- name: Build package
run: |
uv build

- name: Check package
run: |
uvx twine check dist/*

- name: List built packages
run: |
ls -la dist/

- name: Publish to TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: |
uvx twine upload dist/* --verbose

- name: Test installation from TestPyPI
run: |
sleep 30 # Wait for package to be available
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ temp-mail-io
python -c "import tempmail; print('✓ Package installed successfully from TestPyPI')"
python -c "from tempmail import TempMailClient; print('✓ TempMailClient imports successfully')"
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Install dependencies
run: |
uv sync --extra dev

- name: Run pre-commit
run: |
uvx pre-commit run --all-files

- name: Test with pytest
run: |
uv run pytest tests/ -v --cov=tempmail --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading