refactor: Python Inspector Overhaul Part 1 - Buildsystem migration #37
Workflow file for this run
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: Buld and Publish | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build_and_upload: | |
name: Build and Upload Archive | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5.4.0 | |
with: | |
enable-cache: true | |
pyproject-file: "pyproject.toml" | |
- name: Build 📦 package | |
run: | | |
uv sync | |
uv build | |
shell: bash | |
- name: Upload artifacts | |
if: github.event_name == 'push' | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 | |
with: | |
name: pypi_archives | |
path: dist/python_inspector-*-py3-none-any.whl | |
overwrite: true | |
create-gh-release: | |
name: Create GH release | |
runs-on: ubuntu-24.04 | |
needs: build_and_upload | |
steps: | |
- name: Download built archives | |
if: github.event_name == 'push' | |
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # 4.2.1 | |
with: | |
name: pypi_archives | |
path: dist | |
- name: Create GH release | |
if: github.event_name == 'push' | |
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # 2.2.1 | |
with: | |
draft: true | |
files: dist/* | |
create-pypi-release: | |
name: Create PyPI release | |
needs: create-gh-release | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install uv | |
if: github.event_name == 'push' | |
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5.4.0 | |
with: | |
enable-cache: true | |
pyproject-file: "pyproject.toml" | |
- name: Publish | |
if: github.event_name == 'push' | |
env: | |
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
uv publish dist/* |