Skip to content

add gh action to build and push to pypi when tags are pushed #1

add gh action to build and push to pypi when tags are pushed

add gh action to build and push to pypi when tags are pushed #1

Workflow file for this run

---
name: "Publish PyPi package when a new tag is pushed"
on: # yamllint disable-line rule:truthy
push:
tags:
- 'v*'
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
jobs:
pypi-publish:
name: "upload release to PyPI"
runs-on: "ubuntu-latest"
environment: "pypi-publish"
strategy:
matrix:
workdir: ["client", "server"]
permissions:
id-token: "write"
steps:
# https://github.com/pypa/sampleproject/blob/main/.github/workflows/release.yml
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v4"
with:
python-version: '3.12'
- name: "Install build dependencies"
run: "python -m pip install -U setuptools wheel build"
- name: "Build"
run: "python -m build ."
working-directory: "${{ workdir }}"

Check failure on line 32 in .github/workflows/pypi.yml

View workflow run for this annotation

GitHub Actions / Publish PyPi package when a new tag is pushed

Invalid workflow file

The workflow is not valid. .github/workflows/pypi.yml (Line: 32, Col: 28): Unrecognized named-value: 'workdir'. Located at position 1 within expression: workdir .github/workflows/pypi.yml (Line: 35, Col: 9): Unexpected value 'working-directory'
- name: "Publish package distributions to PyPI"
uses: "pypa/gh-action-pypi-publish@release/v1"
working-directory: "${{ workdir }}"
...