From e9d7cbe628eb36e19e55184b8ff8692e717fd8d5 Mon Sep 17 00:00:00 2001 From: yujun Date: Thu, 17 Jul 2025 17:20:56 +0800 Subject: [PATCH 1/4] add docs publish --- .circleci/config.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69a7af9..315d744 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,27 @@ jobs: python3 -m pip install twine python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl - + 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-interconnection \ + --index-js _build/esm/index.js workflows: publish-workflow: when: @@ -57,3 +77,9 @@ workflows: filters: tags: only: /.*/ + - docs_publish: + filters: + branches: + only: main + tags: + only: /^v.*/ From 8d7b2981d02a5c2d583b0624c1ebbf8a90b994c9 Mon Sep 17 00:00:00 2001 From: yujun Date: Thu, 17 Jul 2025 17:36:17 +0800 Subject: [PATCH 2/4] add docs publish --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 315d744..445cd0f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,9 +77,13 @@ workflows: filters: tags: only: /.*/ + - docs_publish: + filters: + tags: + only: /.*/ + docs-workflow: + jobs: - docs_publish: filters: branches: only: main - tags: - only: /^v.*/ From b8c297f4d90dcd3f8debfc000791c8c0e52a7f79 Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 18 Jul 2025 16:37:00 +0800 Subject: [PATCH 3/4] add docs publish --- .circleci/config.yml | 31 -------------------- .github/workflows/docs-publish.yml | 46 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/docs-publish.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 445cd0f..698b673 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,27 +47,6 @@ jobs: python3 -m pip install twine python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl - 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-interconnection \ - --index-js _build/esm/index.js workflows: publish-workflow: when: @@ -77,13 +56,3 @@ workflows: filters: tags: only: /.*/ - - docs_publish: - filters: - tags: - only: /.*/ - docs-workflow: - jobs: - - docs_publish: - filters: - branches: - only: main diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml new file mode 100644 index 0000000..102fc22 --- /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: + - '*' + +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-interconnection \ + --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 165926529781b50a841dee0fb443237ef7bf8d9d Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 18 Jul 2025 16:38:24 +0800 Subject: [PATCH 4/4] add docs publish --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 698b673..69a7af9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,6 +47,7 @@ jobs: python3 -m pip install twine python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl + workflows: publish-workflow: when: