Skip to content

Commit cf791f1

Browse files
authored
build: fix CI config (#326)
1 parent 1c720ca commit cf791f1

File tree

1 file changed

+69
-2
lines changed

1 file changed

+69
-2
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,11 @@ jobs:
659659
- build
660660
- resolve-next-release
661661
- release
662-
steps: &update-documentation-website-steps
662+
663+
# All steps are copied to `update-documentation-website-no-release` job
664+
# Can be replaced with YAML anchors when this will be supported by GitHub Actions:
665+
# https://github.com/actions/runner/issues/1182#issuecomment-2317953582
666+
steps:
663667
- uses: actions/checkout@v4
664668
with:
665669
lfs: true
@@ -737,4 +741,67 @@ jobs:
737741
needs:
738742
- build
739743
- resolve-next-release
740-
steps: *update-documentation-website-steps
744+
745+
# All steps are copied to `update-documentation-website` job
746+
# Can be replaced with YAML anchors when this will be supported by GitHub Actions:
747+
# https://github.com/actions/runner/issues/1182#issuecomment-2317953582
748+
steps:
749+
- uses: actions/checkout@v4
750+
with:
751+
lfs: true
752+
- uses: actions/setup-node@v4
753+
with:
754+
node-version: "20"
755+
- name: Install modules
756+
run: npm ci
757+
- uses: actions/download-artifact@v4
758+
with:
759+
path: artifacts
760+
- name: Move artifacts
761+
run: |
762+
mv artifacts/build dist/
763+
764+
cp -r artifacts/llama.cpp/llama.cpp llama/llama.cpp
765+
766+
rm -f ./llama/binariesGithubRelease.json
767+
mv artifacts/llama.cpp/binariesGithubRelease.json ./llama/binariesGithubRelease.json
768+
769+
rm -f ./llama/llama.cpp.info.json
770+
mv artifacts/llama.cpp/llama.cpp.info.json ./llama/llama.cpp.info.json
771+
- name: Resolve docs version
772+
env:
773+
RELEASE_VERSION: ${{ needs.release.outputs.package-version || needs.resolve-next-release.outputs.next-version }}
774+
run: |
775+
if [ "$RELEASE_VERSION" == "false" ]; then
776+
npx --no vite-node ./scripts/resolveLatestReleaseVersion.ts --saveVersionToFile ./docsVersion.txt
777+
else
778+
echo "$RELEASE_VERSION" > ./docsVersion.txt
779+
fi
780+
- name: Generate docs with updated version
781+
env:
782+
DOCS_URL_BASE: "/"
783+
run: |
784+
export DOCS_PACKAGE_VERSION="$(cat ./docsVersion.txt)"
785+
echo "Package version: $DOCS_PACKAGE_VERSION"
786+
787+
git apply --ignore-whitespace ./scripts/patches/vitepress+1.3.4.patch
788+
npm run docs:build
789+
- name: Upload docs
790+
uses: actions/upload-artifact@v4
791+
with:
792+
include-hidden-files: true
793+
retention-days: 2
794+
name: "docs-site"
795+
path: docs-site
796+
# - name: Upload docs to GitHub Pages
797+
# uses: actions/upload-pages-artifact@v3
798+
# with:
799+
# name: pages-docs
800+
# path: docs-site
801+
# - name: Deploy docs to GitHub Pages
802+
# uses: actions/deploy-pages@v4
803+
# with:
804+
# artifact_name: pages-docs
805+
# - name: Update feed
806+
# run: |
807+
# curl -X POST "https://pubsubhubbub.appspot.com/" -H "Content-Type: application/x-www-form-urlencoded" --data-urlencode "hub.mode=publish" --data-urlencode "hub.url=https://node-llama-cpp.withcat.ai/blog/feed.atom"

0 commit comments

Comments
 (0)