mirror of
https://lavaforge.org/spotizerr/spotizerr-auth.git
synced 2025-12-24 02:39:16 -05:00
43 lines
979 B
YAML
43 lines
979 B
YAML
name: Publish to PyPI
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*" # Triggers only on version tags
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
|
|
- name: Update version in setup.cfg from tag
|
|
run: |
|
|
VERSION="${GITHUB_REF_NAME#v}"
|
|
sed -i -E "s/^version = .*/version = ${VERSION}/" setup.cfg
|
|
echo "Updated setup.cfg version to ${VERSION}"
|
|
grep -n '^version = ' setup.cfg
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Publish to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|