Skip to content

configure the release to PyPI #9

configure the release to PyPI

configure the release to PyPI #9

Workflow file for this run

name: PyPI
on:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
build:
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.11'
cache: pip
- uses: RalfG/[email protected]
with:
python-versions: 'cp311-cp311 cp312-cp312'
- run: find dist -name '*linux_x86_64.whl' -delete
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
test:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dispatch-functions
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
release:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://pypi.org/p/dispatch-functions
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1