Skip to content

chore: prepare release 0.1.3 #2

chore: prepare release 0.1.3

chore: prepare release 0.1.3 #2

Workflow file for this run

# AgentOps Toolkit — Staging (TestPyPI)
#
# Workflows:
# 1. ci.yml — Lint + test on every push/PR
# 2. _build.yml — Reusable build (test + package), called by staging and release
# 3. staging.yml — Staging: release/* branch → TestPyPI → verify
# 4. release.yml — Production: v* tag → TestPyPI → verify → PyPI → GitHub Release
#
# Triggered by pushes to release/* branches.
# Calls the reusable _build.yml, publishes to TestPyPI, and verifies the
# package installs correctly with a CLI smoke test.
#
# This workflow lets you iterate on a release branch and validate the
# built package before tagging for production.
#
# Branch flow:
# develop → release/v0.2.0 → push → this workflow
# → build → TestPyPI → verify install → ✅ ready to merge and tag
#
# Versioning:
# Uses setuptools-scm — on a release branch 5 commits after the last tag,
# the version will be something like 0.2.0.dev5 (PEP 440 pre-release).
#
# Required GitHub secrets (environment: staging):
# TEST_PYPI_TOKEN — TestPyPI API token
#
# Setup:
# 1. https://test.pypi.org/manage/account/token/ → Create TEST_PYPI_TOKEN
# 2. GitHub repo → Settings → Secrets → Actions → Add to staging environment
name: Staging
on:
push:
branches:
- "release/**"
workflow_dispatch:
jobs:
# Reusable build: test + package
build:
uses: ./.github/workflows/_build.yml
# Publish to TestPyPI
publish-testpypi:
needs: build
runs-on: ubuntu-latest
environment: staging
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- 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 # Allow re-pushes without failure
# Install from TestPyPI and smoke-test the CLI
verify-testpypi:
needs: publish-testpypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
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 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 — version and help
run: |
agentops --version
agentops --help
- name: Smoke test — init in temp directory
run: |
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
agentops init
test -f .agentops/config.yaml
test -f .agentops/run.yaml
echo "✅ agentops init succeeded"