Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,34 @@ jobs:
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: Publish
if: env.changed == 'true'
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN_TEMP }}
packages_dir: ./dist/

- name: No Deploy Needed
if: env.changed == 'false'
run: echo "No deploy needed"
37 changes: 37 additions & 0 deletions .github/workflows/test_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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"