Skip to content

fix: Correct dependency in publish job to reference build-wheel #3

fix: Correct dependency in publish job to reference build-wheel

fix: Correct dependency in publish job to reference build-wheel #3

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run pre-commit hooks
uses: pre-commit/action@v4.3.0
with:
extra_args: --show-diff-on-failure
test:
needs: pre-commit
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10','3.11','3.12','3.13','3.14']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: Install Astral UV
uses: astral/uv-action@v1
- name: Install dependencies with uv
run: uv install
- name: Run tests with uv
run: uv run pytest -q --cov=zipfile64 --cov-report=xml:coverage.xml
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml
build-wheel:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}-build
restore-keys: |
${{ runner.os }}-pip-
- name: Install Astral UV
uses: astral/uv-action@v1
- name: Build wheel with uv
run: uv build --wheel --outdir dist
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/*.whl
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build-wheel
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/zipfile64
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1