add gh action to build and push to pypi when tags are pushed #1
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
--- | ||
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 GitHub Actions / Publish PyPi package when a new tag is pushedInvalid workflow file
|
||
- name: "Publish package distributions to PyPI" | ||
uses: "pypa/gh-action-pypi-publish@release/v1" | ||
working-directory: "${{ workdir }}" | ||
... |