From 774eb982a52b7e85bce92d116705474eca70c37d Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Sat, 11 Apr 2026 21:28:47 -0400 Subject: [PATCH] unify to use docs.yml --- .github/workflows/docs.yml | 15 ++++++++++- .github/workflows/nightly.yml | 2 ++ .github/workflows/post_release.yml | 41 ++++-------------------------- 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b170dbaa..a4d79f43 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,15 @@ name: docs on: workflow_dispatch: workflow_call: + inputs: + version: + description: "The version to deploy." + required: true + type: string + alias: + description: "An optional alias to update." + required: false + type: string push: branches: - main @@ -44,7 +53,11 @@ jobs: - name: Build and deploy docs with mike run: | cd docs - mike deploy nightly --push + if [[ -n "${{ inputs.alias }}" ]]; then + mike deploy --push ${{ inputs.version }} --update-aliases ${{ inputs.alias }} + else + mike deploy --push ${{ inputs.version }} + fi publish-gh-pages: needs: [build-documentation] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8300d5ae..729f8d50 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -160,3 +160,5 @@ jobs: contents: write uses: ./.github/workflows/docs.yml secrets: inherit + with: + version: nightly diff --git a/.github/workflows/post_release.yml b/.github/workflows/post_release.yml index 28967933..adf8013c 100644 --- a/.github/workflows/post_release.yml +++ b/.github/workflows/post_release.yml @@ -45,46 +45,15 @@ jobs: docs: needs: [initialize] - runs-on: ubuntu-24.04 - permissions: - contents: write - steps: - - name: Set release version - shell: bash - run: | - echo "RELEASE_VERSION=${{ needs.initialize.outputs.version }}" >> $GITHUB_ENV - - - name: Validate release version - run: | - echo "Release version: ${{ env.RELEASE_VERSION }}" - - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: 3.12 - - - name: Install Python dependencies - run: pip install -r docs/requirements.txt - - - name: Configure git user and email - run: ./scripts/ci/configure_git.sh - - - name: Build and deploy docs with mike as the latest stable branch - run: | - cd docs - mike deploy --push --update-aliases ${RELEASE_VERSION} stable - - publish-gh-pages: - needs: [docs] permissions: pages: write id-token: write - uses: ./.github/workflows/publish_github_pages.yml + contents: write + uses: ./.github/workflows/docs.yml secrets: inherit + with: + version: ${{ needs.initialize.outputs.version }} + alias: "stable" chocolatey: needs: [initialize]