chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
name: Check Codex Skill
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'codex-skill/**'
|
||||
- 'cli-anything-plugin/**'
|
||||
- 'docs/PREVIEW_PROTOCOL.md'
|
||||
- '.github/workflows/check-codex-skill.yml'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'codex-skill/**'
|
||||
- 'cli-anything-plugin/**'
|
||||
- 'docs/PREVIEW_PROTOCOL.md'
|
||||
- '.github/workflows/check-codex-skill.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-installer:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Test Codex skill installer
|
||||
run: bash codex-skill/tests/test_install.sh
|
||||
@@ -0,0 +1,35 @@
|
||||
name: Check Root Skills
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '*/agent-harness/**'
|
||||
- 'skills/**'
|
||||
- '.github/scripts/sync_root_skills.py'
|
||||
- '.github/scripts/validate_root_skills.py'
|
||||
- '.github/workflows/check-root-skills.yml'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '*/agent-harness/**'
|
||||
- 'skills/**'
|
||||
- '.github/scripts/sync_root_skills.py'
|
||||
- '.github/scripts/validate_root_skills.py'
|
||||
- '.github/workflows/check-root-skills.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
validate-root-skills:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Validate root skills mirror
|
||||
run: python3 .github/scripts/validate_root_skills.py
|
||||
@@ -0,0 +1,101 @@
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '*/agent-harness/**'
|
||||
- 'registry.json'
|
||||
- 'public_registry.json'
|
||||
- 'matrix_registry.json'
|
||||
- 'cli-hub/**'
|
||||
- 'cli-hub-matrix/**'
|
||||
- 'docs/hub/**'
|
||||
- '.github/workflows/deploy-pages.yml'
|
||||
- '.github/scripts/update_registry_dates.py'
|
||||
- '.github/scripts/generate_meta_skill.py'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Generate registry dates
|
||||
run: python3 .github/scripts/update_registry_dates.py
|
||||
|
||||
- name: Generate meta-skill
|
||||
run: python3 .github/scripts/generate_meta_skill.py
|
||||
|
||||
- name: Install AWS CLI
|
||||
run: pip install awscli
|
||||
|
||||
- name: Upload SKILL.md to DO Spaces
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.DO_SPACES_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_SPACES_SECRET }}
|
||||
run: |
|
||||
aws s3 cp cli-hub-skill/SKILL.md \
|
||||
s3://${{ secrets.DO_SPACES_BUCKET }}/SKILL.md \
|
||||
--endpoint-url ${{ secrets.DO_SPACES_ENDPOINT }} \
|
||||
--acl public-read \
|
||||
--content-type text/markdown
|
||||
|
||||
- name: Copy registries to hub for cli-hub access
|
||||
run: |
|
||||
cp registry.json docs/hub/registry.json
|
||||
cp public_registry.json docs/hub/public_registry.json
|
||||
|
||||
- name: Copy matrix_registry.json to hub for cli-hub access
|
||||
run: cp matrix_registry.json docs/hub/matrix_registry.json
|
||||
|
||||
- name: Build with Jekyll
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./docs/hub
|
||||
destination: ./docs/_site
|
||||
|
||||
# Copied after the Jekyll build so SKILL.md front matter is served
|
||||
# verbatim instead of being converted to HTML. Published at
|
||||
# https://hkuds.github.io/CLI-Anything/matrix/<name>/{SKILL.md,references/,scripts/}
|
||||
# (consumed by cli_hub.matrix_skill's published-URL fallback).
|
||||
- name: Copy matrix skill content into site
|
||||
run: |
|
||||
sudo mkdir -p docs/_site/matrix
|
||||
sudo rsync -a --exclude='__pycache__' --exclude='*.pyc' --exclude='*.pyo' \
|
||||
cli-hub-matrix/ docs/_site/matrix/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: './docs/_site'
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -0,0 +1,43 @@
|
||||
name: PR Labeler Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/labeler.yml"
|
||||
- ".github/scripts/pr-labeler.js"
|
||||
- ".github/scripts/tests/pr-labeler-fixtures.json"
|
||||
- ".github/scripts/tests/pr-labeler.test.js"
|
||||
- ".github/workflows/pr-labeler.yml"
|
||||
- ".github/workflows/pr-labeler-tests.yml"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- ".github/labeler.yml"
|
||||
- ".github/scripts/pr-labeler.js"
|
||||
- ".github/scripts/tests/pr-labeler-fixtures.json"
|
||||
- ".github/scripts/tests/pr-labeler.test.js"
|
||||
- ".github/workflows/pr-labeler.yml"
|
||||
- ".github/workflows/pr-labeler-tests.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Validate PR labeler script
|
||||
run: node --check .github/scripts/pr-labeler.js
|
||||
|
||||
- name: Run PR labeler tests
|
||||
run: node .github/scripts/tests/pr-labeler.test.js
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Pull Request Labeler
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out base branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Apply computed labels
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const labelPullRequest = require("./.github/scripts/pr-labeler.js");
|
||||
await labelPullRequest({ github, context, core });
|
||||
|
||||
- name: Apply path labels
|
||||
uses: actions/labeler@v6
|
||||
with:
|
||||
configuration-path: .github/labeler.yml
|
||||
sync-labels: true
|
||||
@@ -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/
|
||||
Reference in New Issue
Block a user