@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
yml 118 lines 4.3 KB
Raw
1 name: Publish composio-core 0.7.22
2
3 run-name: Publish composio-core 0.7.22 (publish=${{ inputs.publish }})
4
5 on:
6 workflow_dispatch:
7 inputs:
8 publish:
9 description: Upload the verified artifacts to PyPI
10 required: true
11 type: boolean
12 default: false
13
14 permissions:
15 contents: read
16
17 concurrency:
18 group: publish-composio-core-0.7.22
19 cancel-in-progress: false
20
21 jobs:
22 build:
23 name: Build composio-core
24 runs-on: ubuntu-latest
25 timeout-minutes: 10
26 steps:
27 - name: Checkout locked release tools
28 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29 with:
30 persist-credentials: false
31
32 - name: Checkout reviewed composio-core source
33 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
34 with:
35 ref: 7a9b0412fbdb33776f4d6c916537d74cb1bf0835 # PR #4270 merged into archive-v2
36 path: legacy-source
37 persist-credentials: false
38
39 - name: Setup Python and uv
40 uses: ./.github/actions/setup-python-uv
41 with:
42 uv-version: '0.13.4'
43 enable-caching: 'false'
44
45 - name: Install locked build tools
46 working-directory: python
47 env:
48 UV_PROJECT_ENVIRONMENT: ${{ github.workspace }}/.release-venv
49 run: uv sync --locked --only-group release
50
51 - name: Build composio-core
52 run: .release-venv/bin/python -m build --no-isolation legacy-source/python --outdir dist
53
54 - name: Verify package identity and deprecation description
55 run: |
56 .release-venv/bin/python - <<'PY'
57 from email import message_from_bytes
58 from pathlib import Path
59 import tarfile
60 import zipfile
61
62 dist = Path("dist")
63 wheel = "composio_core-0.7.22-py3-none-any.whl"
64 sdist = "composio_core-0.7.22.tar.gz"
65 if {p.name for p in dist.iterdir()} != {wheel, sdist}:
66 raise SystemExit("Expected only the composio-core 0.7.22 wheel and sdist")
67 readme = Path("legacy-source/python/README.md").read_text(encoding="utf-8").strip()
68 if not readme.startswith("# DEPRECATED: use `composio`"):
69 raise SystemExit("Missing deprecation notice")
70 with zipfile.ZipFile(dist / wheel) as archive:
71 metadata = archive.read("composio_core-0.7.22.dist-info/METADATA")
72 with tarfile.open(dist / sdist) as archive:
73 package_info = archive.extractfile("composio_core-0.7.22/PKG-INFO").read()
74 for content in (metadata, package_info):
75 message = message_from_bytes(content)
76 if message["Name"].replace("_", "-") != "composio-core" or message["Version"] != "0.7.22":
77 raise SystemExit("Unexpected package identity")
78 if set(message["Requires-Python"].split(",")) != {">=3.9", "<4"}:
79 raise SystemExit("Legacy Python compatibility changed")
80 if message.get_payload().strip() != readme:
81 raise SystemExit("Package description differs from the reviewed README")
82 print("Verified both composio-core 0.7.22 artifacts and their deprecation descriptions")
83 PY
84
85 - name: Store verified artifacts
86 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
87 with:
88 name: composio-core-0.7.22
89 path: |
90 dist/composio_core-0.7.22-py3-none-any.whl
91 dist/composio_core-0.7.22.tar.gz
92 if-no-files-found: error
93 retention-days: 1
94
95 # The composio-core project must trust this workflow and its dedicated environment.
96 # Build steps never receive publishing credentials or an OIDC token.
97 publish:
98 name: Publish composio-core
99 if: inputs.publish
100 needs: build
101 runs-on: ubuntu-latest
102 timeout-minutes: 5
103 environment:
104 name: pypi-composio-core
105 permissions:
106 id-token: write
107 steps:
108 - name: Download verified artifacts
109 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
110 with:
111 name: composio-core-0.7.22
112 path: dist/
113
114 - name: Publish composio-core to PyPI
115 uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
116 with:
117 packages-dir: dist/
118 skip-existing: true