Skip to content

DEP: drop dangling runtime dependency on setuptools #9

DEP: drop dangling runtime dependency on setuptools

DEP: drop dangling runtime dependency on setuptools #9

Workflow file for this run

name: Release
on:
pull_request:
push:
tags:
- '*'
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels'))
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.8
- name: Install python-build and twine
run: python -m pip install build "twine>=3.3"
- name: Build package
run: python -m build --sdist --wheel .
- name: List result
run: ls -l dist
- name: Check long_description
run: python -m twine check --strict dist/*
- name: Test package
run: |
cd ..
python -m venv testenv
testenv/bin/pip install pytest sphinx astropy-sphinx-theme/dist/*.whl
testenv/bin/pytest astropy-sphinx-theme/astropy_sphinx_theme/tests
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
with:
user: __token__
password: ${{ secrets.pypi_password }}