[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
# This is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
# | |
name: Release | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/release.yaml" | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".github/workflows/*" | |
- "!.github/workflows/release.yaml" | |
branches-ignore: | |
- "dependabot/**" | |
- "pre-commit-ci-update-config" | |
tags: | |
- "**" | |
workflow_dispatch: | |
jobs: | |
publish-to-pypi: | |
runs-on: ubuntu-22.04 | |
environment: release | |
permissions: | |
# id-token=write is required for pypa/gh-action-pypi-publish, and the PyPI | |
# project needs to be configured to trust this workflow. | |
# | |
# ref: https://github.com/jupyterhub/team-compass/issues/648 | |
# | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install build package | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
pip freeze | |
- name: Build release | |
run: | | |
python -m build --sdist --wheel . | |
ls -alh dist | |
# ref: https://github.com/pypa/gh-action-pypi-publish | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: pypa/gh-action-pypi-publish@release/v1 |