feat(studio): wake sleeping agents on demand (#1078) #1762
This file contains hidden or 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: Publish Tag to PyPI | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| harness-sidecar-release-gate: | |
| uses: ./.github/workflows/harness-sidecar-release-gate.yaml | |
| build: | |
| needs: harness-sidecar-release-gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| # setuptools-scm derives the version from git tags, so the build | |
| # needs full history and all tags (not the default shallow clone). | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install build tool | |
| run: python3 -m pip install build --user --upgrade | |
| - name: Build wheel and source distribution | |
| run: python3 -m build | |
| - name: Verify native AgentKit CLI archives stay outside Python distributions | |
| run: | | |
| python3 - <<'PY' | |
| import tarfile | |
| import zipfile | |
| from pathlib import Path | |
| root = Path.cwd() | |
| wheels = list((root / "dist").glob("*.whl")) | |
| if len(wheels) != 1: | |
| raise SystemExit("Expected exactly one VeADK wheel") | |
| with zipfile.ZipFile(wheels[0]) as archive: | |
| names = archive.namelist() | |
| if any("agentkit-linux-" in name or "agentkit-windows-" in name for name in names): | |
| raise SystemExit("VeADK wheel must not embed an AgentKit CLI archive") | |
| metadata_name = next( | |
| name for name in names if name.endswith(".dist-info/METADATA") | |
| ) | |
| metadata = archive.read(metadata_name).decode() | |
| if "volcengine-agentkit-cli-bin" in metadata: | |
| raise SystemExit("VeADK wheel must not depend on an unpublished CLI companion") | |
| sdists = list((root / "dist").glob("*.tar.gz")) | |
| if len(sdists) != 1: | |
| raise SystemExit("Expected exactly one VeADK source distribution") | |
| with tarfile.open(sdists[0], "r:gz") as archive: | |
| if any( | |
| "agentkit-linux-" in member.name or "agentkit-windows-" in member.name | |
| for member in archive.getmembers() | |
| ): | |
| raise SystemExit("VeADK sdist must not embed an AgentKit CLI archive") | |
| PY | |
| - name: Reject distributions over the PyPI file-size limit | |
| run: | | |
| oversized_file="$(find dist -type f -size +100M -print -quit)" | |
| if [ -n "${oversized_file}" ]; then | |
| bytes="$(stat -c%s "${oversized_file}")" | |
| echo "Distribution exceeds PyPI's 100 MiB limit: ${oversized_file} (${bytes} bytes)" | |
| exit 1 | |
| fi | |
| - name: Upload distributables as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish-to-pypi: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| steps: | |
| - name: Download distributables | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Install Twine | |
| run: python3 -m pip install --user --upgrade twine packaging | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| python3 -m twine upload dist/* |