mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 08:20:14 +01:00
* v0.8.1 * fix: GitHub workflows for OIDC trusted publishing - Added permissions for OIDC trusted publishing in client, data-provider, and data-schemas workflows. - Updated npm installation to support OIDC in all workflows. - Changed npm publish commands to include `--provenance` for better package integrity. - Updated repository URLs in package.json files for client, data-provider, and data-schemas to remove `git+` prefix.
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: Publish `@librechat/client` to NPM
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'packages/client/package.json'
|
|
workflow_dispatch:
|
|
inputs:
|
|
reason:
|
|
description: 'Reason for manual trigger'
|
|
required: false
|
|
default: 'Manual publish requested'
|
|
|
|
permissions:
|
|
id-token: write # Required for OIDC trusted publishing
|
|
contents: read
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
environment: publish # Must match npm trusted publisher config
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Update npm for OIDC support
|
|
run: npm install -g npm@latest # Must be 11.5.1+ for provenance
|
|
|
|
- name: Install client dependencies
|
|
run: cd packages/client && npm ci
|
|
|
|
- name: Build client
|
|
run: cd packages/client && npm run build
|
|
|
|
- name: Check version change
|
|
id: check
|
|
working-directory: packages/client
|
|
run: |
|
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
PUBLISHED_VERSION=$(npm view @librechat/client version 2>/dev/null || echo "0.0.0")
|
|
if [ "$PACKAGE_VERSION" = "$PUBLISHED_VERSION" ]; then
|
|
echo "No version change, skipping publish"
|
|
echo "skip=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Version changed, proceeding with publish"
|
|
echo "skip=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Pack package
|
|
if: steps.check.outputs.skip != 'true'
|
|
working-directory: packages/client
|
|
run: npm pack
|
|
|
|
- name: Publish
|
|
if: steps.check.outputs.skip != 'true'
|
|
working-directory: packages/client
|
|
run: npm publish *.tgz --access public --provenance
|