diff --git a/.github/workflows/publish_pypi_thirdweb_ai.yaml b/.github/workflows/publish_pypi_thirdweb_ai.yaml deleted file mode 100644 index cc28466..0000000 --- a/.github/workflows/publish_pypi_thirdweb_ai.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish thirdweb AI to PyPI - -on: - workflow_dispatch: - -jobs: - deploy-pypi-thirdweb-ai: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./python/thirdweb-ai - environment: - name: pypi - url: https://pypi.org/p/thirdweb-ai - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Install uv - uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5 - - - name: Install Python - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" # Update cache if uv.lock changes - - - name: Install the project - run: uv sync - - - name: Build package - run: uv build - - - name: Publish package - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 - with: - user: __token__ - password: ${{ secrets.PYPI_API_KEY }} - packages-dir: python/thirdweb-ai/dist/ diff --git a/.github/workflows/publish_pypi_thirdweb_mcp.yaml b/.github/workflows/publish_pypi_thirdweb_mcp.yaml deleted file mode 100644 index 2ead948..0000000 --- a/.github/workflows/publish_pypi_thirdweb_mcp.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish thirdweb MCP to PyPI - -on: - workflow_dispatch: - -jobs: - deploy-pypi-thirdweb-mcp: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./python/thirdweb-mcp - environment: - name: pypi - url: https://pypi.org/p/thirdweb-mcp - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Install uv - uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5 - - - name: Install Python - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 - with: - enable-cache: true - cache-dependency-glob: "uv.lock" # Update cache if uv.lock changes - - - name: Install the project - run: uv sync - - - name: Build package - run: uv build - - - name: Publish package - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 - with: - user: __token__ - password: ${{ secrets.PYPI_API_KEY }} - packages-dir: python/thirdweb-mcp/dist/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4f97580 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Build and Publish + +on: + release: + types: [published] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Install uv + uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5 + + - name: Install Python + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" # Update cache if uv.lock changes + + - name: Build thirdweb-mcp + run: | + cd python/thirdweb-mcp + uv build + + - name: Build thirdweb-ai + run: | + cd python/thirdweb-ai + uv build + + - name: Publish to PyPI + if: github.event_name == 'release' && github.event.action == 'published' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages-dir: thirdweb-mcp/dist/ thirdweb-ai/dist/