Skip to content

chore: remove [Unreleased] changelog pattern from all files #95

chore: remove [Unreleased] changelog pattern from all files

chore: remove [Unreleased] changelog pattern from all files #95

Workflow file for this run

# AgentOps Toolkit — CI/CD Pipelines
#
# Workflows:
# 1. ci.yml — Lint + test on every push/PR; publish dev builds to TestPyPI on develop
# 2. _build.yml — Reusable build (test + package), called by staging and release
# 3. staging.yml — Staging: release/* branch → TestPyPI → verify; VSIX pre-release → Marketplace
# 4. release.yml — Production: v* tag → TestPyPI → verify → PyPI → GitHub Release; VSIX stable → Marketplace
# 5. cut-release.yml — Manual dispatch: create release branch + PR from develop
name: CI
on:
push:
branches: [develop]
pull_request:
branches: [develop]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ">=0.9.0"
enable-cache: false # test matrix saves this cache key
- name: Set up Python
run: uv python install 3.11
- name: Install dependencies
run: uv sync --group dev
- name: Lint with ruff
run: uv run ruff check src/ tests/
- name: Type check with mypy
run: uv run mypy src/agentops/ --ignore-missing-imports
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ">=0.9.0"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Run tests
run: uv run pytest tests/ -v --tb=short --junitxml=test-results.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: test-results.xml
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ">=0.9.0"
enable-cache: false # test matrix saves this cache key
- name: Set up Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --group dev
- name: Run tests with coverage
run: uv run pytest tests/ --cov=agentops --cov-report=xml --cov-report=term-missing
- name: Upload coverage
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage.xml
# Publish dev build to TestPyPI on every push to develop (not PRs)
publish-dev:
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs: [lint, test]
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history for setuptools-scm
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ">=0.9.0"
enable-cache: false # test matrix saves this cache key
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --group dev
- name: Build package
run: uv build
- name: Show version
run: |
ls -la dist/
uv run python -c "from importlib.metadata import version; print(f'Dev version: {version(\"agentops-toolkit\")}')"
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_TOKEN }}
verbose: true
skip-existing: true
# Verify the dev build installs correctly
verify-dev:
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs: publish-dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Determine expected version
id: version
run: |
pip install setuptools-scm
VERSION=$(python -m setuptools_scm)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Expected dev version: $VERSION"
- name: Install from TestPyPI
run: |
for i in 1 2 3 4 5; do
echo "Attempt $i: installing agentops-toolkit==${{ steps.version.outputs.version }}"
pip install \
"agentops-toolkit==${{ steps.version.outputs.version }}" \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
&& break
echo "Not available yet, waiting 30s..."
sleep 30
done
- name: Smoke test
run: |
agentops --version
agentops --help
- name: Summary
run: |
echo "## ✅ Dev build published and verified" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- Version: \`${{ steps.version.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- TestPyPI: https://test.pypi.org/project/agentops-toolkit/${{ steps.version.outputs.version }}/" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Install: \`pip install agentops-toolkit==${{ steps.version.outputs.version }} --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/\`" >> "$GITHUB_STEP_SUMMARY"
# Validate that the VSIX extension packages correctly
build-vsix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history for version derivation
- name: Sync VSIX version from git tag
run: |
# Use global tag sort (not git describe) to find the latest tag
# across ALL branches, not just reachable ones from HEAD.
LAST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1)
LAST_TAG=${LAST_TAG:-v0.0.0}
LAST_VERSION=${LAST_TAG#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$LAST_VERSION"
if git describe --tags --exact-match HEAD >/dev/null 2>&1; then
BASE_VERSION="$LAST_VERSION"
else
BASE_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
fi
jq --arg v "$BASE_VERSION" '.version = $v' \
plugins/agentops/package.json > plugins/agentops/package.json.tmp
mv plugins/agentops/package.json.tmp plugins/agentops/package.json
echo "VSIX version set to $BASE_VERSION (from tag $LAST_TAG)"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Package VSIX (dry run)
working-directory: plugins/agentops
run: vsce package -o agentops-skills.vsix
- name: Show VSIX info
run: |
ls -la plugins/agentops/*.vsix
echo "✅ VSIX packaging validated"
- name: Upload VSIX artifact
uses: actions/upload-artifact@v7
with:
name: vsix
path: plugins/agentops/*.vsix
# Publish VSIX pre-release to Marketplace on every push to develop (not PRs)
publish-vsix-dev:
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
needs: [lint, test, build-vsix]
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history for version derivation
- name: Sync VSIX version from git tag
run: |
# Use global tag sort (not git describe) to find the latest tag
# across ALL branches, not just reachable ones from HEAD.
LAST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1)
LAST_TAG=${LAST_TAG:-v0.0.0}
LAST_VERSION=${LAST_TAG#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$LAST_VERSION"
if git describe --tags --exact-match HEAD >/dev/null 2>&1; then
BASE_VERSION="$LAST_VERSION"
else
BASE_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
fi
jq --arg v "$BASE_VERSION" '.version = $v' \
plugins/agentops/package.json > plugins/agentops/package.json.tmp
mv plugins/agentops/package.json.tmp plugins/agentops/package.json
echo "VSIX version set to $BASE_VERSION (from tag $LAST_TAG)"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Package VSIX (pre-release)
working-directory: plugins/agentops
run: vsce package --pre-release -o agentops-skills.vsix
- name: Publish pre-release to VS Code Marketplace
continue-on-error: true # Tolerate "already exists" for dev builds
working-directory: plugins/agentops
run: vsce publish --pre-release --packagePath agentops-skills.vsix -p "${{ secrets.VSCE_PAT }}"
- name: Summary
run: |
echo "## ✅ VSIX pre-release published to Marketplace" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Extension: [AgentOps Toolkit](https://marketplace.visualstudio.com/items?itemName=AgentOpsToolkit.agentops-toolkit)" >> "$GITHUB_STEP_SUMMARY"