Skip to content

feat(otlp): add --format otlp-genai with OTel GenAI semantic conventi… #21

feat(otlp): add --format otlp-genai with OTel GenAI semantic conventi…

feat(otlp): add --format otlp-genai with OTel GenAI semantic conventi… #21

Workflow file for this run

name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v4
- name: Read current version
id: version
run: |
VERSION=$(grep '^__version__' src/agent_trace/__init__.py \
| sed 's/.*"\(.*\)"/\1/')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Check if release already exists
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
TAG="v${VERSION}"
if gh release view "$TAG" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Release $TAG already exists — skipping."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Build changelog
if: steps.check.outputs.exists == 'false'
run: |
LAST_TAG=$(git describe --tags --abbrev=0 --exclude="${{ steps.check.outputs.tag }}" 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
git log --pretty=format:"- %s" HEAD | head -20 > /tmp/changelog.txt
else
git log "${LAST_TAG}..HEAD" --pretty=format:"- %s" > /tmp/changelog.txt
fi
- name: Create GitHub Release
if: steps.check.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.check.outputs.tag }}"
gh release create "$TAG" \
--title "$TAG" \
--notes-file /tmp/changelog.txt \
--target "${{ github.sha }}"