From 60a2d51ac0d1d1de4283ae25799ce1c7169b7de8 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 11:49:34 +0530 Subject: [PATCH 01/10] test: docs symlinking --- .github/workflows/update-docs-test.yml | 124 +++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/update-docs-test.yml diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml new file mode 100644 index 000000000..96a8a4ff0 --- /dev/null +++ b/.github/workflows/update-docs-test.yml @@ -0,0 +1,124 @@ +name: "Update Docs - Test" + +on: + workflow_dispatch: + inputs: + is-latest: + description: "Is this the latest version?" + type: boolean + default: false + required: true + +permissions: + contents: write + +jobs: + setup: + runs-on: ubuntu-latest + + outputs: + constantsVersion: ${{ steps.versions.outputs.constantsVersion }} + constantsVersionXy: ${{ steps.versions.outputs.constantsVersionXy }} + setupVersion: ${{ steps.versions.outputs.setupVersion }} + setupVersionXy: ${{ steps.versions.outputs.setupVersionXy }} + newestVersion: ${{ steps.versions.outputs.newestVersion }} + targetBranch: ${{ steps.versions.outputs.targetBranch }} + devTag: ${{ steps.versions.outputs.devTag }} + releaseTag: ${{ steps.versions.outputs.releaseTag }} + versionFolder: ${{ steps.versions.outputs.versionFolder }} + artifactName: ${{ steps.versions.outputs.artifactName }} + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + fetch-tags: true + token: ${{ secrets.ALL_REPO_PAT }} + + - name: Populate variables + id: versions + run: | + . ./hooks/populate-hook-constants.sh + + echo "constantsVersion=$constantsVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "constantsVersionXy=$constantsVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "setupVersion=$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "setupVersionXy=$setupVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + echo "devTag=dev-v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "releaseTag=v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + echo "versionFolder=$setupVersionXy.X" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "artifactName=python-docs-$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + publish-docs: + runs-on: ubuntu-latest + needs: setup + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.setup.outputs.releaseTag }} + fetch-tags: true + # path: supertokens-python + + # - uses: actions/checkout@v4 + # with: + # repository: supertokens/supertokens-backend-website + # token: ${{ secrets.ALL_REPO_PAT }} + # path: supertokens-backend-website + + # - run: | + # shopt -s extglob # Enable extended globbing + + # pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ + + # # Delete the current version folder if it exists + # rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # # Copy the current docs + # mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + + # if [[ "true" == "true" ]] + # then + # # Delete everything except the version folders + # rm -rf $pythonDocDir/!(*.*.X) + + # # Copy files to the root dir + # # cp -r supertokens-python/html/* $pythonDocDir/ + + # ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html + # fi + + # - uses: actions/upload-artifact@v4 + # with: + # name: ${{ needs.setup.outputs.artifactName }} + # path: supertokens-backend-website/app/docs/sdk/docs/python + + - uses: actions/upload-artifact@v4 + with: + name: ${{ needs.setup.outputs.artifactName }} + path: html/supertokens_python + + - name: Trigger the backend website CI + uses: actions/github-script@v7 + with: + # NOTE: We should use a better scoped PAT here. + github-token: ${{ secrets.ALL_REPO_PAT }} + script: | + github.rest.actions.createWorkflowDispatch({ + owner: 'supertokens', + repo: 'supertokens-backend-website', + workflow_id: 'release-python-documentation-changes.yml', + ref: 'feat/python-node-docs', + inputs: { + "version": `${{ needs.setup.outputs.setupVersion }}`, + "artifact-name": `${{ needs.setup.outputs.artifactName }}`, + "version-folder": `app/docs/sdk/docs/python`, + "is-latest": `${{ inputs.is-latest }}`, + "run-id": `${{ github.run_id }}`, + "stage": "preview", + } + }) From 9bce9751a170137b014d83ad1c499679a3061633 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:19:23 +0530 Subject: [PATCH 02/10] update: upload entire python folder as artifact --- .github/workflows/pipeline-release-tag.yml | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline-release-tag.yml b/.github/workflows/pipeline-release-tag.yml index 18308d2e5..706f770f1 100644 --- a/.github/workflows/pipeline-release-tag.yml +++ b/.github/workflows/pipeline-release-tag.yml @@ -250,6 +250,9 @@ jobs: - setup - release + outputs: + isLatest: ${{ steps.merge-check.outputs.isLatest }} + steps: - uses: actions/checkout@v4 with: @@ -267,10 +270,13 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Check API and merge to master + id: merge-check run: | response=`curl -s -X GET "https://api.supertokens.io/0/driver/latest/check?password=${{ secrets.SUPERTOKENS_API_KEY }}&version=${{ needs.setup.outputs.setupVersion }}&name=python" -H 'api-version: 0'` isLatest=$(echo $response | jq .isLatest) + echo "isLatest=$isLatest" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + if [[ $isLatest == "true" ]] then git checkout master @@ -288,17 +294,42 @@ jobs: needs: - setup - release + - merge steps: - uses: actions/checkout@v4 with: ref: ${{ needs.setup.outputs.releaseTag }} fetch-tags: true + path: supertokens-python + + - uses: actions/checkout@v4 + with: + repository: supertokens/supertokens-backend-website + token: ${{ secrets.ALL_REPO_PAT }} + path: supertokens-backend-website + + - run: | + shopt -s extglob # Enable extended globbing + + if [[ "${{ needs.merge.outputs.isLatest }}" == "true" ]] + then + # Delete everything except the version folders + rm -rf supertokens-backend-website/app/docs/sdk/docs/python/!(*.*.X) + # Copy files to the root dir + cp -r supertokens-python/html/supertokens_python/* supertokens-backend-website/app/docs/sdk/docs/python/ + fi + + # Delete the current version folder if it exists + rm -rf supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }} + # Copy the current docs + mkdir -p supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }} + cp -r supertokens-python/html/supertokens_python/* supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }} - uses: actions/upload-artifact@v4 with: name: ${{ needs.setup.outputs.artifactName }} - path: html/supertokens_python + path: supertokens-backend-website/app/docs/sdk/docs/python - name: Trigger the backend website CI uses: actions/github-script@v7 @@ -314,7 +345,7 @@ jobs: inputs: { "version": `${{ needs.setup.outputs.setupVersion }}`, "artifact-name": `${{ needs.setup.outputs.artifactName }}`, - "version-folder": `${{ needs.setup.outputs.versionFolder }}`, + "version-folder": `app/docs/sdk/docs/python`, "run-id": `${{ github.run_id }}`, "stage": "production", } From 0e3a72fb9c8792bdf2ed3a53b775096c226f090f Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:19:40 +0530 Subject: [PATCH 03/10] Revert "test: docs symlinking" This reverts commit 60a2d51ac0d1d1de4283ae25799ce1c7169b7de8. --- .github/workflows/update-docs-test.yml | 124 ------------------------- 1 file changed, 124 deletions(-) delete mode 100644 .github/workflows/update-docs-test.yml diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml deleted file mode 100644 index 96a8a4ff0..000000000 --- a/.github/workflows/update-docs-test.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: "Update Docs - Test" - -on: - workflow_dispatch: - inputs: - is-latest: - description: "Is this the latest version?" - type: boolean - default: false - required: true - -permissions: - contents: write - -jobs: - setup: - runs-on: ubuntu-latest - - outputs: - constantsVersion: ${{ steps.versions.outputs.constantsVersion }} - constantsVersionXy: ${{ steps.versions.outputs.constantsVersionXy }} - setupVersion: ${{ steps.versions.outputs.setupVersion }} - setupVersionXy: ${{ steps.versions.outputs.setupVersionXy }} - newestVersion: ${{ steps.versions.outputs.newestVersion }} - targetBranch: ${{ steps.versions.outputs.targetBranch }} - devTag: ${{ steps.versions.outputs.devTag }} - releaseTag: ${{ steps.versions.outputs.releaseTag }} - versionFolder: ${{ steps.versions.outputs.versionFolder }} - artifactName: ${{ steps.versions.outputs.artifactName }} - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch }} - fetch-tags: true - token: ${{ secrets.ALL_REPO_PAT }} - - - name: Populate variables - id: versions - run: | - . ./hooks/populate-hook-constants.sh - - echo "constantsVersion=$constantsVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "constantsVersionXy=$constantsVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "setupVersion=$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "setupVersionXy=$setupVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - echo "devTag=dev-v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "releaseTag=v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - echo "versionFolder=$setupVersionXy.X" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "artifactName=python-docs-$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - publish-docs: - runs-on: ubuntu-latest - needs: setup - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.setup.outputs.releaseTag }} - fetch-tags: true - # path: supertokens-python - - # - uses: actions/checkout@v4 - # with: - # repository: supertokens/supertokens-backend-website - # token: ${{ secrets.ALL_REPO_PAT }} - # path: supertokens-backend-website - - # - run: | - # shopt -s extglob # Enable extended globbing - - # pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ - - # # Delete the current version folder if it exists - # rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # # Copy the current docs - # mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - - # if [[ "true" == "true" ]] - # then - # # Delete everything except the version folders - # rm -rf $pythonDocDir/!(*.*.X) - - # # Copy files to the root dir - # # cp -r supertokens-python/html/* $pythonDocDir/ - - # ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html - # fi - - # - uses: actions/upload-artifact@v4 - # with: - # name: ${{ needs.setup.outputs.artifactName }} - # path: supertokens-backend-website/app/docs/sdk/docs/python - - - uses: actions/upload-artifact@v4 - with: - name: ${{ needs.setup.outputs.artifactName }} - path: html/supertokens_python - - - name: Trigger the backend website CI - uses: actions/github-script@v7 - with: - # NOTE: We should use a better scoped PAT here. - github-token: ${{ secrets.ALL_REPO_PAT }} - script: | - github.rest.actions.createWorkflowDispatch({ - owner: 'supertokens', - repo: 'supertokens-backend-website', - workflow_id: 'release-python-documentation-changes.yml', - ref: 'feat/python-node-docs', - inputs: { - "version": `${{ needs.setup.outputs.setupVersion }}`, - "artifact-name": `${{ needs.setup.outputs.artifactName }}`, - "version-folder": `app/docs/sdk/docs/python`, - "is-latest": `${{ inputs.is-latest }}`, - "run-id": `${{ github.run_id }}`, - "stage": "preview", - } - }) From 7a212ccf11b8ba73dbad094d3cdfbb3e8ea3c1ef Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:28:16 +0530 Subject: [PATCH 04/10] Reapply "test: docs symlinking" This reverts commit 0e3a72fb9c8792bdf2ed3a53b775096c226f090f. --- .github/workflows/update-docs-test.yml | 124 +++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/update-docs-test.yml diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml new file mode 100644 index 000000000..96a8a4ff0 --- /dev/null +++ b/.github/workflows/update-docs-test.yml @@ -0,0 +1,124 @@ +name: "Update Docs - Test" + +on: + workflow_dispatch: + inputs: + is-latest: + description: "Is this the latest version?" + type: boolean + default: false + required: true + +permissions: + contents: write + +jobs: + setup: + runs-on: ubuntu-latest + + outputs: + constantsVersion: ${{ steps.versions.outputs.constantsVersion }} + constantsVersionXy: ${{ steps.versions.outputs.constantsVersionXy }} + setupVersion: ${{ steps.versions.outputs.setupVersion }} + setupVersionXy: ${{ steps.versions.outputs.setupVersionXy }} + newestVersion: ${{ steps.versions.outputs.newestVersion }} + targetBranch: ${{ steps.versions.outputs.targetBranch }} + devTag: ${{ steps.versions.outputs.devTag }} + releaseTag: ${{ steps.versions.outputs.releaseTag }} + versionFolder: ${{ steps.versions.outputs.versionFolder }} + artifactName: ${{ steps.versions.outputs.artifactName }} + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + fetch-tags: true + token: ${{ secrets.ALL_REPO_PAT }} + + - name: Populate variables + id: versions + run: | + . ./hooks/populate-hook-constants.sh + + echo "constantsVersion=$constantsVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "constantsVersionXy=$constantsVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "setupVersion=$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "setupVersionXy=$setupVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + echo "devTag=dev-v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "releaseTag=v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + echo "versionFolder=$setupVersionXy.X" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + echo "artifactName=python-docs-$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" + + publish-docs: + runs-on: ubuntu-latest + needs: setup + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.setup.outputs.releaseTag }} + fetch-tags: true + # path: supertokens-python + + # - uses: actions/checkout@v4 + # with: + # repository: supertokens/supertokens-backend-website + # token: ${{ secrets.ALL_REPO_PAT }} + # path: supertokens-backend-website + + # - run: | + # shopt -s extglob # Enable extended globbing + + # pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ + + # # Delete the current version folder if it exists + # rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # # Copy the current docs + # mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + + # if [[ "true" == "true" ]] + # then + # # Delete everything except the version folders + # rm -rf $pythonDocDir/!(*.*.X) + + # # Copy files to the root dir + # # cp -r supertokens-python/html/* $pythonDocDir/ + + # ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html + # fi + + # - uses: actions/upload-artifact@v4 + # with: + # name: ${{ needs.setup.outputs.artifactName }} + # path: supertokens-backend-website/app/docs/sdk/docs/python + + - uses: actions/upload-artifact@v4 + with: + name: ${{ needs.setup.outputs.artifactName }} + path: html/supertokens_python + + - name: Trigger the backend website CI + uses: actions/github-script@v7 + with: + # NOTE: We should use a better scoped PAT here. + github-token: ${{ secrets.ALL_REPO_PAT }} + script: | + github.rest.actions.createWorkflowDispatch({ + owner: 'supertokens', + repo: 'supertokens-backend-website', + workflow_id: 'release-python-documentation-changes.yml', + ref: 'feat/python-node-docs', + inputs: { + "version": `${{ needs.setup.outputs.setupVersion }}`, + "artifact-name": `${{ needs.setup.outputs.artifactName }}`, + "version-folder": `app/docs/sdk/docs/python`, + "is-latest": `${{ inputs.is-latest }}`, + "run-id": `${{ github.run_id }}`, + "stage": "preview", + } + }) From 0ed2ec7a81a283033210a55c34a6dfdcf9e0448c Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:30:12 +0530 Subject: [PATCH 05/10] update: adds test workflow to check Py docs publish --- .github/workflows/update-docs-test.yml | 66 ++++++++++++-------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml index 96a8a4ff0..0310ef230 100644 --- a/.github/workflows/update-docs-test.yml +++ b/.github/workflows/update-docs-test.yml @@ -1,13 +1,9 @@ name: "Update Docs - Test" on: - workflow_dispatch: - inputs: - is-latest: - description: "Is this the latest version?" - type: boolean - default: false - required: true + pull_request: + types: + - synchronize permissions: contents: write @@ -62,45 +58,45 @@ jobs: with: ref: ${{ needs.setup.outputs.releaseTag }} fetch-tags: true - # path: supertokens-python + path: supertokens-python - # - uses: actions/checkout@v4 - # with: - # repository: supertokens/supertokens-backend-website - # token: ${{ secrets.ALL_REPO_PAT }} - # path: supertokens-backend-website + - uses: actions/checkout@v4 + with: + repository: supertokens/supertokens-backend-website + token: ${{ secrets.ALL_REPO_PAT }} + path: supertokens-backend-website - # - run: | - # shopt -s extglob # Enable extended globbing + - run: | + shopt -s extglob # Enable extended globbing - # pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ + pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ - # # Delete the current version folder if it exists - # rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # # Copy the current docs - # mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # Delete the current version folder if it exists + rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + # Copy the current docs + mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # if [[ "true" == "true" ]] - # then - # # Delete everything except the version folders - # rm -rf $pythonDocDir/!(*.*.X) + if [[ "true" == "true" ]] + then + # Delete everything except the version folders + rm -rf $pythonDocDir/!(*.*.X) - # # Copy files to the root dir - # # cp -r supertokens-python/html/* $pythonDocDir/ + # Copy files to the root dir + # cp -r supertokens-python/html/* $pythonDocDir/ - # ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html - # fi - - # - uses: actions/upload-artifact@v4 - # with: - # name: ${{ needs.setup.outputs.artifactName }} - # path: supertokens-backend-website/app/docs/sdk/docs/python + ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html + fi - uses: actions/upload-artifact@v4 with: name: ${{ needs.setup.outputs.artifactName }} - path: html/supertokens_python + path: supertokens-backend-website/app/docs/sdk/docs/python + + # - uses: actions/upload-artifact@v4 + # with: + # name: ${{ needs.setup.outputs.artifactName }} + # path: html/supertokens_python - name: Trigger the backend website CI uses: actions/github-script@v7 From 5b1768e870eea3712da2486f5f068299d143e4f5 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:34:37 +0530 Subject: [PATCH 06/10] update: fix test workflow --- .github/workflows/update-docs-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml index 0310ef230..9eec9e68b 100644 --- a/.github/workflows/update-docs-test.yml +++ b/.github/workflows/update-docs-test.yml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + # ref: ${{ inputs.branch }} fetch-tags: true token: ${{ secrets.ALL_REPO_PAT }} @@ -113,7 +113,7 @@ jobs: "version": `${{ needs.setup.outputs.setupVersion }}`, "artifact-name": `${{ needs.setup.outputs.artifactName }}`, "version-folder": `app/docs/sdk/docs/python`, - "is-latest": `${{ inputs.is-latest }}`, + "is-latest": `true`, "run-id": `${{ github.run_id }}`, "stage": "preview", } From 2552677365ef14840439d88657d6e831b0b1e590 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:36:28 +0530 Subject: [PATCH 07/10] update: fix test workflow --- .github/workflows/update-docs-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml index 9eec9e68b..184213584 100644 --- a/.github/workflows/update-docs-test.yml +++ b/.github/workflows/update-docs-test.yml @@ -113,7 +113,6 @@ jobs: "version": `${{ needs.setup.outputs.setupVersion }}`, "artifact-name": `${{ needs.setup.outputs.artifactName }}`, "version-folder": `app/docs/sdk/docs/python`, - "is-latest": `true`, "run-id": `${{ github.run_id }}`, "stage": "preview", } From ec9e9c66fe6aa1956b563610a007773a01144708 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:46:42 +0530 Subject: [PATCH 08/10] update: test branch name --- .github/workflows/update-docs-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml index 184213584..6a799d12d 100644 --- a/.github/workflows/update-docs-test.yml +++ b/.github/workflows/update-docs-test.yml @@ -108,7 +108,7 @@ jobs: owner: 'supertokens', repo: 'supertokens-backend-website', workflow_id: 'release-python-documentation-changes.yml', - ref: 'feat/python-node-docs', + ref: 'python-node-docs', inputs: { "version": `${{ needs.setup.outputs.setupVersion }}`, "artifact-name": `${{ needs.setup.outputs.artifactName }}`, From eef47b40073cd701896218779771d89350dc0e2b Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 12:54:35 +0530 Subject: [PATCH 09/10] fix: test docs python paths --- .github/workflows/update-docs-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml index 6a799d12d..9ed16bce0 100644 --- a/.github/workflows/update-docs-test.yml +++ b/.github/workflows/update-docs-test.yml @@ -75,7 +75,7 @@ jobs: rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} # Copy the current docs mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} + cp -r supertokens-python/html/supertokens_python* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} if [[ "true" == "true" ]] then @@ -83,9 +83,7 @@ jobs: rm -rf $pythonDocDir/!(*.*.X) # Copy files to the root dir - # cp -r supertokens-python/html/* $pythonDocDir/ - - ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html + cp -r supertokens-python/html/supertokens_python/* $pythonDocDir/ fi - uses: actions/upload-artifact@v4 From 0262b55e3903cbae252074ccc4af8bb6f9510d68 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Thu, 26 Jun 2025 13:10:59 +0530 Subject: [PATCH 10/10] update: remove test workflow --- .github/workflows/update-docs-test.yml | 117 ------------------------- 1 file changed, 117 deletions(-) delete mode 100644 .github/workflows/update-docs-test.yml diff --git a/.github/workflows/update-docs-test.yml b/.github/workflows/update-docs-test.yml deleted file mode 100644 index 9ed16bce0..000000000 --- a/.github/workflows/update-docs-test.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: "Update Docs - Test" - -on: - pull_request: - types: - - synchronize - -permissions: - contents: write - -jobs: - setup: - runs-on: ubuntu-latest - - outputs: - constantsVersion: ${{ steps.versions.outputs.constantsVersion }} - constantsVersionXy: ${{ steps.versions.outputs.constantsVersionXy }} - setupVersion: ${{ steps.versions.outputs.setupVersion }} - setupVersionXy: ${{ steps.versions.outputs.setupVersionXy }} - newestVersion: ${{ steps.versions.outputs.newestVersion }} - targetBranch: ${{ steps.versions.outputs.targetBranch }} - devTag: ${{ steps.versions.outputs.devTag }} - releaseTag: ${{ steps.versions.outputs.releaseTag }} - versionFolder: ${{ steps.versions.outputs.versionFolder }} - artifactName: ${{ steps.versions.outputs.artifactName }} - - steps: - - uses: actions/checkout@v4 - with: - # ref: ${{ inputs.branch }} - fetch-tags: true - token: ${{ secrets.ALL_REPO_PAT }} - - - name: Populate variables - id: versions - run: | - . ./hooks/populate-hook-constants.sh - - echo "constantsVersion=$constantsVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "constantsVersionXy=$constantsVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "setupVersion=$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "setupVersionXy=$setupVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - echo "devTag=dev-v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "releaseTag=v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - echo "versionFolder=$setupVersionXy.X" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - echo "artifactName=python-docs-$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" - - publish-docs: - runs-on: ubuntu-latest - needs: setup - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.setup.outputs.releaseTag }} - fetch-tags: true - path: supertokens-python - - - uses: actions/checkout@v4 - with: - repository: supertokens/supertokens-backend-website - token: ${{ secrets.ALL_REPO_PAT }} - path: supertokens-backend-website - - - run: | - shopt -s extglob # Enable extended globbing - - pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ - - # Delete the current version folder if it exists - rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - # Copy the current docs - mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - cp -r supertokens-python/html/supertokens_python* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} - - if [[ "true" == "true" ]] - then - # Delete everything except the version folders - rm -rf $pythonDocDir/!(*.*.X) - - # Copy files to the root dir - cp -r supertokens-python/html/supertokens_python/* $pythonDocDir/ - fi - - - uses: actions/upload-artifact@v4 - with: - name: ${{ needs.setup.outputs.artifactName }} - path: supertokens-backend-website/app/docs/sdk/docs/python - - # - uses: actions/upload-artifact@v4 - # with: - # name: ${{ needs.setup.outputs.artifactName }} - # path: html/supertokens_python - - - name: Trigger the backend website CI - uses: actions/github-script@v7 - with: - # NOTE: We should use a better scoped PAT here. - github-token: ${{ secrets.ALL_REPO_PAT }} - script: | - github.rest.actions.createWorkflowDispatch({ - owner: 'supertokens', - repo: 'supertokens-backend-website', - workflow_id: 'release-python-documentation-changes.yml', - ref: 'python-node-docs', - inputs: { - "version": `${{ needs.setup.outputs.setupVersion }}`, - "artifact-name": `${{ needs.setup.outputs.artifactName }}`, - "version-folder": `app/docs/sdk/docs/python`, - "run-id": `${{ github.run_id }}`, - "stage": "preview", - } - })