Skip to content

1.3.4

1.3.4 #13

Workflow file for this run

name: PyPI
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "Tag to build and publish (e.g. 'v1.3.0' or 'refs/tags/v1.3.0'). If provided, takes precedence over 'branch'."
required: false
default: ""
branch:
description: "Branch to build and publish (e.g. 'main' or 'dev'). Used when 'tag' is not provided. Defaults to 'main'."
required: false
default: "main"
jobs:
publish_to_pypi:
# Only run automatically for release events whose tag does NOT contain
# 'rc'. Manual runs (workflow_dispatch) are always allowed.
if: ${{ github.event_name != 'release' || (github.event_name == 'release' && !contains(github.event.release.tag_name, 'rc')) }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/deezy/
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Automatic releases (non-rc) use main; manual runs accept tag or branch.
ref: ${{ github.event_name == 'release' && 'main' || github.event.inputs.tag || github.event.inputs.branch || 'main' }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade uv
uv venv .venv
. .venv/bin/activate && uv pip install --upgrade build twine
- name: Build package
run: . .venv/bin/activate && uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1