Skip to content

PyPI deploy action

PyPI deploy action #2

Workflow file for this run

name: Deploy Python Distribution
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a wheel and a source tarball
working-directory: ./bindings/python
run: |
python -m build --sdist --outdir dist/
- name: Upload artifact
working-directory: ./bindings/python
uses: actions/upload-artifact@v3

Check failure on line 31 in .github/workflows/pypi_deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy Python Distribution

Invalid workflow file

The workflow is not valid. .github/workflows/pypi_deploy.yml (Line: 31, Col: 7): Unexpected value 'uses' .github/workflows/pypi_deploy.yml (Line: 32, Col: 7): Unexpected value 'with'
with:
name: ghex-dist
path: ./dist/**
# publish-pypi:
# name: Publish Python distribution to pypi.org
# runs-on: ubuntu-latest
# needs: build
# if: ${{ github.event_name == 'workflow_dispatch' }} # the action was triggered manually
# environment:
# name: pypi
# url: https://pypi.org/project/ghex
# permissions:
# id-token: write
# steps:
# - name: Download wheel
# uses: actions/download-artifact@v3
# with:
# name: ghex-dist
# path: dist
# - name: Publish distribution to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
publish-test-pypi:
name: Publish Python distribution to test.pypi.org
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'workflow-dispatch' }} # TODO: once working, enable line below
# if: ${{ github.event_name == 'release' }} # triggered by releasing on github, test first before manually triggering the deployment to PyPI (see release documentation)
environment:
name: testpypi
url: https://test.pypi.org/project/ghex/
permissions:
id-token: write
steps:
- name: Download wheel
uses: actions/download-artifact@v3
with:
name: ghex-dist
path: dist
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/