mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-16 20:56:35 +01:00
feat: update GitHub Actions workflow to publish @librechat/client
This commit is contained in:
parent
83477bba34
commit
f741a59ec4
1 changed files with 35 additions and 9 deletions
44
.github/workflows/client.yml
vendored
44
.github/workflows/client.yml
vendored
|
|
@ -1,6 +1,11 @@
|
||||||
name: Publish `@librechat/client` to NPM
|
name: Publish `@librechat/client` to NPM
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'packages/client/package.json'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
reason:
|
reason:
|
||||||
|
|
@ -17,16 +22,37 @@ jobs:
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: '20.x'
|
||||||
|
|
||||||
- name: Check if client package exists
|
- name: Install dependencies
|
||||||
|
run: cd packages/client && npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cd packages/client && npm run build
|
||||||
|
|
||||||
|
- name: Set up npm authentication
|
||||||
|
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.PUBLISH_NPM_TOKEN }}" > ~/.npmrc
|
||||||
|
|
||||||
|
- name: Check version change
|
||||||
|
id: check
|
||||||
|
working-directory: packages/client
|
||||||
run: |
|
run: |
|
||||||
if [ -d "packages/client" ]; then
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
||||||
echo "Client package directory found"
|
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
|
else
|
||||||
echo "Client package directory not found - workflow ready for future use"
|
echo "Version changed, proceeding with publish"
|
||||||
exit 0
|
echo "skip=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Placeholder for future publishing
|
- name: Pack package
|
||||||
run: echo "Client package publishing workflow is ready"
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue