From 299a7982401cd3cf11c5ce51cf821547cd71791d Mon Sep 17 00:00:00 2001 From: yujun Date: Thu, 17 Jul 2025 16:19:16 +0800 Subject: [PATCH 1/4] add docs publish --- .circleci/config.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94a4c16..90589a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,29 @@ parameters: type: string default: "" +jobs: + docs_publish: + docker: + - image: cimg/python:3.10-node + shell: /bin/bash --login -eo pipefail + steps: + - checkout + - run: + name: Build docs and publish + command: | + set -ex + cd docs + export DRY_RUN=0 + export DOCTOOLS_PUBLISH_NPM_TOKEN=${DOCTOOLS_PUBLISH_NPM_TOKEN} + sudo apt-get update && sudo apt install -y git + python3 -m venv ~/.venv/docs + source ~/.venv/docs/bin/activate + python -m pip install -r requirements.txt + secretflow-doctools build --lang zh_CN --lang en + secretflow-doctools publish \ + --name @secretflow/x-spec \ + --index-js _build/esm/index.js + workflows: unittest-workflow: when: @@ -50,6 +73,12 @@ workflows: .circleci/continue-config.yml base true secretflow_spec/.* spec true tests/.* test true + - docs_publish: + filters: + branches: + only: main + tags: + only: /^v.*/ publish-workflow: when: equal: ["publish_pypi", << pipeline.parameters.GHA_Meta >>] From dc4b813a38dc434c84843279937995c27abd832c Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 18 Jul 2025 17:46:51 +0800 Subject: [PATCH 2/4] add docs publish --- .circleci/config.yml | 29 ------------------- .github/workflows/docs-publish.yml | 46 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/docs-publish.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 90589a1..94a4c16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,29 +34,6 @@ parameters: type: string default: "" -jobs: - docs_publish: - docker: - - image: cimg/python:3.10-node - shell: /bin/bash --login -eo pipefail - steps: - - checkout - - run: - name: Build docs and publish - command: | - set -ex - cd docs - export DRY_RUN=0 - export DOCTOOLS_PUBLISH_NPM_TOKEN=${DOCTOOLS_PUBLISH_NPM_TOKEN} - sudo apt-get update && sudo apt install -y git - python3 -m venv ~/.venv/docs - source ~/.venv/docs/bin/activate - python -m pip install -r requirements.txt - secretflow-doctools build --lang zh_CN --lang en - secretflow-doctools publish \ - --name @secretflow/x-spec \ - --index-js _build/esm/index.js - workflows: unittest-workflow: when: @@ -73,12 +50,6 @@ workflows: .circleci/continue-config.yml base true secretflow_spec/.* spec true tests/.* test true - - docs_publish: - filters: - branches: - only: main - tags: - only: /^v.*/ publish-workflow: when: equal: ["publish_pypi", << pipeline.parameters.GHA_Meta >>] diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml new file mode 100644 index 0000000..cd067a9 --- /dev/null +++ b/.github/workflows/docs-publish.yml @@ -0,0 +1,46 @@ +# Copyright 2025 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Publish Docs +on: + push: + branches: + - main + tags: + - 'v*' + +jobs: + check-docs: + name: check docs + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: pubilsh docs + run: | + python3 -m venv ~/.venv/docs + source ~/.venv/docs/bin/activate + python -m pip install -r docs/requirements.txt + secretflow-doctools build --lang zh_CN --lang en + secretflow-doctools publish \ + --name @secretflow/x-spec \ + --index-js docs/_build/esm/index.js + env: + DRY_RUN: "0" # omit in test runs + DOCTOOLS_PUBLISH_NPM_TOKEN: ${{secrets.DOCTOOLS_PUBLISH_NPM_TOKEN}} From 7b457a701d748d770f1532013052b9b03027c673 Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 18 Jul 2025 17:59:33 +0800 Subject: [PATCH 3/4] add docs publish --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94a4c16..aff192e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ workflows: tests/.* test true publish-workflow: when: - equal: ["publish_pypi", << pipeline.parameters.GHA_Meta >>] + equal: [ "publish_pypi", << pipeline.parameters.GHA_Meta >> ] jobs: - continuation/continue: configuration_path: .circleci/release-config.yml From 7b0d91154abf84a34cf10632f1145c0d755223b2 Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 18 Jul 2025 18:00:49 +0800 Subject: [PATCH 4/4] add docs publish --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aff192e..94a4c16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ workflows: tests/.* test true publish-workflow: when: - equal: [ "publish_pypi", << pipeline.parameters.GHA_Meta >> ] + equal: ["publish_pypi", << pipeline.parameters.GHA_Meta >>] jobs: - continuation/continue: configuration_path: .circleci/release-config.yml