Skip to content

check if pyproject has changed before publishing #1

check if pyproject has changed before publishing

check if pyproject has changed before publishing #1

Workflow file for this run

name: PYPI Release
on:
pull_request:
branches: [main]
jobs:
pypi_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if `pyproject.toml` has changed
id: check_file_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q 'pyproject.toml'; then
echo "changed=true" >> $GITHUB_ENV
else
echo "changed=false" >> $GITHUB_ENV
- name: Install UV
if: env.changed == 'true'
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Source Cargo Environment
if: env.changed == 'true'
run: source $HOME/.cargo/env
- name: Build with UV
if: env.changed == 'true'
run: uvx --from build pyproject-build --installer uv
- name: No Deploy Needed
if: env.changed == 'false'
run: echo "No deploy needed"