Update cooperative_pong to v6 (#1292) #393
This file contains hidden or 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 workflow will build and (if release) publish Python distributions to PyPI | |
# For more information see: | |
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
name: build-publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
pull_request: | |
paths: | |
- .github/workflows/build-publish.yml | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Build sdist and wheel | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: python -m pip install --upgrade setuptools wheel build | |
- name: Build sdist and wheel | |
run: python -m build --sdist --wheel | |
- name: Store sdist and wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
publish: | |
name: Publish to PyPI | |
needs: [build] | |
runs-on: ubuntu-latest | |
environment: pypi | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Download dist | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |