From b8652548ad240691adfc97a73d1f9effa60545fd Mon Sep 17 00:00:00 2001 From: tison Date: Thu, 2 May 2024 16:43:27 +0800 Subject: [PATCH] ci: fixup release nodejs and rc site (#4569) Signed-off-by: tison --- .github/workflows/ci_bindings_nodejs.yml | 4 +++- .github/workflows/docs.yml | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_bindings_nodejs.yml b/.github/workflows/ci_bindings_nodejs.yml index ab748f513cc2..460b7ac7b523 100644 --- a/.github/workflows/ci_bindings_nodejs.yml +++ b/.github/workflows/ci_bindings_nodejs.yml @@ -92,7 +92,7 @@ jobs: -e NAPI_TARGET=x86_64-unknown-linux-gnu \ -w /build/bindings/nodejs \ ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian \ - bash -c "pnpm build" + bash -c "corepack enable && pnpm build" cd bindings/nodejs # change owner to current user sudo chown -R 1001:121 *.node @@ -105,6 +105,7 @@ jobs: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 \ bash -c "set -e && rustup target add aarch64-unknown-linux-gnu && + corepack enable && pnpm build --target aarch64-unknown-linux-gnu && aarch64-unknown-linux-gnu-strip *.node" cd bindings/nodejs @@ -119,6 +120,7 @@ jobs: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine \ bash -c "set -e && rustup target add aarch64-unknown-linux-musl && + corepack enable && pnpm build --target aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node" cd bindings/nodejs diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ead8f97250c9..194104ee4c48 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -488,13 +488,20 @@ jobs: publish_dir: website/build publish_branch: site/main-staging + - name: Prepare rc staged name + if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'rc') }} + run: | + export OPENDAL_WEBSITE_STAGED_NAME=$(echo ${{ github.ref_name }} | sed 's/[.-]/_/g') + echo OPENDAL_WEBSITE_STAGED_NAME=${OPENDAL_WEBSITE_STAGED_NAME} + echo OPENDAL_WEBSITE_STAGED_NAME=${OPENDAL_WEBSITE_STAGED_NAME} >> $GITHUB_ENV + - name: Deploy to rc staged uses: peaceiris/actions-gh-pages@v3.9.2 if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'rc') }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: website/build - publish_branch: site/${{ github.ref_name }}-staging + publish_branch: site/${{ env.OPENDAL_WEBSITE_STAGED_NAME }}-staging - name: Clear build run: rm -rf ./website/build