Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

put cli-hub auto-publish yml

yuhao9e586b09fc86
diff --git a/.github/workflows/publish-cli-hub.yml b/.github/workflows/publish-cli-hub.yml
new file mode 100644
index 000000000..1cf62dfb3
--- /dev/null
+++ b/.github/workflows/publish-cli-hub.yml
@@ -0,0 +1,48 @@
+name: Publish cli-anything-hub to PyPI
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - "cli-hub/**"
+ - "!cli-hub/tests/**"
+ - "!cli-hub/README.md"
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ permissions:
+ id-token: write # required for trusted publishing
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Check if version already published
+ id: check
+ run: |
+ VERSION=$(python -c "import re; print(re.search(r'version=\"([^\"]+)\"', open('cli-hub/setup.py').read()).group(1))")
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/cli-anything-hub/$VERSION/json")
+ if [ "$STATUS" = "200" ]; then
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ echo "Version $VERSION already on PyPI — skipping."
+ else
+ echo "skip=false" >> "$GITHUB_OUTPUT"
+ echo "Version $VERSION not on PyPI — will publish."
+ fi
+
+ - name: Build package
+ if: steps.check.outputs.skip == 'false'
+ run: |
+ pip install build
+ cd cli-hub
+ python -m build
+
+ - name: Publish to PyPI
+ if: steps.check.outputs.skip == 'false'
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ packages-dir: cli-hub/dist/