Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [dev, main]

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -124,3 +124,51 @@ jobs:
-f tests/e2e/docker-compose.yml \
-p litellm-client-e2e \
down -v --remove-orphans || true

# ───────────────────── publish (push to main only) ───────────
# Fires after every CI gate passes on a push to main. Skips silently
# if package.json version is already on npm — bump the version to
# ship a release.
publish:
runs-on: ubuntu-latest
needs: [lint, unit-tests, build, e2e]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org

- name: Check if version is already published
id: version_check
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
PUBLISHED=$(npm view litellm-client version 2>/dev/null || echo "")
echo "pkg_version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "published=$PUBLISHED" >> "$GITHUB_OUTPUT"
if [ "$PKG_VERSION" = "$PUBLISHED" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "::notice title=Publish skipped::version $PKG_VERSION already on npm"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi

- run: npm ci
if: steps.version_check.outputs.skip == 'false'

- run: npm run build
if: steps.version_check.outputs.skip == 'false'

# Authenticates to npm via OIDC (Trusted Publishing). No NPM_TOKEN
# required — the `id-token: write` permission above + a Trusted
# Publisher configured at npmjs.com/package/litellm-client/access
# for this repo + workflow is what authorizes the publish.
- name: Publish to npm
if: steps.version_check.outputs.skip == 'false'
run: npm publish --provenance --access public
37 changes: 0 additions & 37 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# litellm-client

[![CI](https://github.com/visgotti/litellm-client/actions/workflows/ci.yml/badge.svg)](https://github.com/visgotti/litellm-client/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/visgotti/litellm-client/branch/main/graph/badge.svg)](https://codecov.io/gh/visgotti/litellm-client)
[![codecov](https://codecov.io/gh/visgotti/litellm-client/graph/badge.svg?token=U7KS3N0NQ7)](https://codecov.io/gh/visgotti/litellm-client)
[![npm](https://img.shields.io/npm/v/litellm-client.svg)](https://www.npmjs.com/package/litellm-client)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "litellm-client",
"version": "1.0.0",
"version": "1.0.1",
"description": "Production-grade TypeScript client for the LiteLLM proxy server. Zero runtime dependencies, full surface coverage, streaming, retries, typed errors.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Loading