From 53ffa966fc9ff15f2b71a0bdcb0bf4de21048278 Mon Sep 17 00:00:00 2001 From: Taegyun Ha Date: Tue, 31 Mar 2026 11:41:32 +0100 Subject: [PATCH 1/3] add release gh action add tag on release restrict action to main --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e8d404a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Publish to PyPI + +on: + workflow_dispatch: + +permissions: + contents: write + id-token: write + +jobs: + publish: + 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: Build package + run: uv build + + - 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 }}" || echo "Tag already exists, skipping" + git push origin "v${{ steps.version.outputs.version }}" || echo "Tag already pushed, skipping" + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 370f1e4ba78871413e26dd38ea9253fadd44be86 Mon Sep 17 00:00:00 2001 From: Taegyun Ha Date: Tue, 31 Mar 2026 14:51:17 +0100 Subject: [PATCH 2/3] check ci before publish --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4d614c..13a133d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [main, dev] pull_request: branches: [main, dev] + workflow_call: jobs: test: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8d404a..9a83c6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,11 @@ permissions: 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 @@ -36,15 +40,22 @@ jobs: 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 }}" || echo "Tag already exists, skipping" - git push origin "v${{ steps.version.outputs.version }}" || echo "Tag already pushed, skipping" - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + git tag "v${{ steps.version.outputs.version }}" + git push origin "v${{ steps.version.outputs.version }}" From d7ed34ef81648615018abcbcb6f3b81264ba412f Mon Sep 17 00:00:00 2001 From: Taegyun Ha Date: Tue, 31 Mar 2026 14:53:08 +0100 Subject: [PATCH 3/3] update main maintainter --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5c2eb1c..b54eca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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",