Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_call:

jobs:
test:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish to PyPI

on:
workflow_dispatch:

permissions:
contents: write
id-token: write

jobs:
ci:
uses: ./.github/workflows/ci.yml

publish:
needs: ci
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment: pypi
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: "3.12"

- name: Get version
id: version
run: |
VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Check version not already published
run: |
VERSION="${{ steps.version.outputs.version }}"
if uv pip index versions designer-plugin 2>/dev/null | grep -q "$VERSION"; then
echo "Version $VERSION already exists on PyPI. Aborting."
exit 1
fi

- name: Validate tag does not exist
run: |
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "Tag v${{ steps.version.outputs.version }} already exists. Aborting."
exit 1
fi

- name: Build package
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Tag release
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ name = "designer-plugin"
version = "1.3.0"
description = "Python library for creating Disguise Designer plugins with DNS-SD discovery and remote Python execution"
authors = [
{ name = "Tom Whittock", email = "tom.whittock@disguise.one" },
{ name = "Taegyun Ha", email = "taegyun.ha@disguise.one" }
{ name = "Taegyun Ha", email = "taegyun.ha@disguise.one" },
{ name = "Tom Whittock", email = "tom.whittock@disguise.one" }
]
dependencies = [
"aiohttp>=3.13.2",
Expand Down
Loading