-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build api reference of langchain (#10)
- Loading branch information
1 parent
fd57dce
commit 2033246
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and deploy API reference | ||
description: Build and deploy API reference | ||
|
||
inputs: | ||
ragstack-version: | ||
required: true | ||
description: "RAGStack version" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Configure Git | ||
shell: bash | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Generate API reference | ||
shell: bash | ||
run: | | ||
set -e | ||
./scripts/generate-api-reference.sh "${{ inputs.ragstack-version }}" | ||
mv dist/api_reference /tmp/api_reference | ||
git fetch origin | ||
git checkout gh-pages | ||
ls -la /tmp/api_reference/${{ inputs.ragstack-version }}/langchain | ||
mkdir -p api_reference/${{ inputs.ragstack-version }} | ||
mv /tmp/api_reference/${{ inputs.ragstack-version }}/langchain api_reference/${{ inputs.ragstack-version }}/langchain | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "Git directory is clean, nothing changed" | ||
git status | ||
exit 0 | ||
fi | ||
git add -A | ||
git commit -m "Update api reference" | ||
git pull --rebase origin gh-pages | ||
git push origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
here=$(pwd) | ||
ragstack_version=$1 | ||
if [ -z "$ragstack_version" ]; then | ||
echo "Usage: $0 <ragstack_version>" | ||
exit 1 | ||
fi | ||
|
||
langchain_version=$(curl -Ls "https://registry.npmjs.org/@datastax/ragstack-ai-ts/${ragstack_version}" | jq -r '.dependencies.langchain') | ||
echo "langchain_version: $langchain_version" | ||
|
||
clone_lc() { | ||
rm -rf /tmp/lc | ||
git clone https://github.com/langchain-ai/langchainjs.git --branch ${langchain_version} --depth 1 /tmp/lc | ||
} | ||
clone_lc | ||
cd /tmp/lc/docs/api_refs | ||
yarn install | ||
yarn build | ||
|
||
ls -la public | ||
|
||
mkdir -p $here/dist | ||
mkdir -p $here/dist/api_reference | ||
mkdir -p $here/dist/api_reference/$ragstack_version | ||
mkdir -p $here/dist/api_reference/$ragstack_version/langchain | ||
cp -r public/* $here/dist/api_reference/$ragstack_version/langchain |