[pre-commit.ci] pre-commit autoupdate #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build releases and (on tags) publish to PyPI | |
name: Release | |
# always build releases (to make sure wheel-building works) | |
# but only publish to PyPI on tags | |
on: | |
push: | |
branches: | |
- main | |
- "*.x" | |
tags: | |
- "*" | |
pull_request: | |
jobs: | |
build-release: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: install build package | |
run: | | |
pip install --upgrade pip | |
pip install build | |
pip freeze | |
- name: build release | |
run: | | |
python -m build --sdist --wheel . | |
ls -l dist | |
- name: verify wheel | |
run: | | |
cd dist | |
pip install ./*.whl | |
python -c 'import appnope' | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
pip install twine | |
twine upload --skip-existing dist/* |