[bumpversion] 1.1.0-dev0 (#4) #4
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 Python π distributions π¦ to PyPI | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
# if the version.py changes, we should re-publish | ||
# this also allows us to run the workflow manually without skipping. | ||
- "cartesia/version.py" | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/cartesia | ||
# TODO: Make permissions more restrictive | ||
permissions: write-all | ||
env: | ||
commitmsg: ${{ github.event.head_commit.message }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Set up Python | ||
run: uv python install | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Build the project | ||
run: uv build | ||
- name: Publish to PyPI | ||
run: uv publish | ||
with: | ||
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: Get version | ||
run: | | ||
export CARTESIA_PYTHON_VERSION=$(grep -o '".*"' cartesia/version.py | sed 's/"//g') | ||
echo "CARTESIA_PYTHON_VERSION=${CARTESIA_PYTHON_VERSION}" >> $GITHUB_ENV | ||
- name: Verify version | ||
run: echo ${{ env.CARTESIA_PYTHON_VERSION }} | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ env.CARTESIA_PYTHON_VERSION }} |