From 81bf3ed37db4c0132a8c9852d3df23babcb43849 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 3 Oct 2025 14:21:01 -0700 Subject: [PATCH 01/13] deploy-docs-workflow: remove checks of the git-branch ref --- .github/workflows/nodejs.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8a2f528c1d..0aa711872f 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -276,17 +276,8 @@ jobs: url: ${{ steps.docs-artifact.outputs.page_url }} runs-on: ubuntu-latest needs: generate-documentation - # Deploy docs only pushes into the main branch - if: success() && github.ref == 'refs/heads/main' + if: success() steps: - - name: Detect (non-beta) version tag - id: check-tag - run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "published_version_tag=true" >> $GITHUB_OUTPUT - fi - - name: Deploy to Documentation to GitHub Pages id: docs-artifact - if: steps.check-tag.outputs.published_version_tag == 'true' uses: actions/deploy-pages@v4 From b20ac6ade753838427f2b698d6763b28e037b70b Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 3 Oct 2025 15:18:32 -0700 Subject: [PATCH 02/13] deploy docs only on tag push of the form --- .github/workflows/nodejs.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0aa711872f..28a6618a61 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -276,8 +276,15 @@ jobs: url: ${{ steps.docs-artifact.outputs.page_url }} runs-on: ubuntu-latest needs: generate-documentation - if: success() steps: + - name: Detect version tag + id: check-tag + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "published_version_tag=true" >> $GITHUB_OUTPUT + echo "version tag detected in the github push event" + fi - name: Deploy to Documentation to GitHub Pages id: docs-artifact + if: steps.check-tag.outputs.published_version_tag == 'true' uses: actions/deploy-pages@v4 From 1878fd3e2ee950a816ded5118ba0c5fa15f4a49b Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 3 Oct 2025 15:59:11 -0700 Subject: [PATCH 03/13] feat: generate docs only if all the tests pass successfully --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 28a6618a61..934a5334c0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -217,6 +217,7 @@ jobs: generate-documentation: runs-on: ubuntu-latest + needs: [build-and-lint, unit, integration, browser] strategy: matrix: From fefa385431249d08d7bd072d2dc51d954449eacb Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 8 Oct 2025 16:45:25 -0700 Subject: [PATCH 04/13] update the instructions for docs update in CONTRIBUTING file --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6bda0fb2b2..e2fa8f54d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -241,7 +241,7 @@ Note: The same updated config can be used to update xrpl-py's CI as well. - [ ] Update the version number and release date, and ensure it lists the changes since the previous release. -4. Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta). +4. (This step is performed by `generate-documentation` nodejs.yml Github Actions workflow) Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta). 5. Run `npm run clean` to delete previously generated artifacts. 6. Run `npm run build` to triple check the build still works 7. Run `npx lerna version --no-git-tag-version` - This bumps the package versions. @@ -265,6 +265,8 @@ Note: The same updated config can be used to update xrpl-py's CI as well. 13. Run `git tag -m `, where `` is the new package and version (e.g. `xrpl@2.1.1`), for each version released. 14. Run `git push --follow-tags`, to push the tags to Github. +Note: Pushing a tag in the format of `vA.B.C` triggers the `deploy-docs-pages` workflow in the `nodejs.yml` Github Actions workflow. This updates the documentation in js.xrpl.org to match the code changes in the checked out git branch. + 15. On GitHub, click the "Releases" link on the right-hand side of the page. 16. Repeat for each release: From 30d614a7b42986221b782b8a5ac7837dd037ae97 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 9 Oct 2025 12:31:51 -0700 Subject: [PATCH 05/13] update regex to match tags of the form xrpl@A.B.C --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 934a5334c0..55ed41ba6a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -281,7 +281,7 @@ jobs: - name: Detect version tag id: check-tag run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ${{ github.event.ref }} =~ ^refs/tags/xrpl@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "published_version_tag=true" >> $GITHUB_OUTPUT echo "version tag detected in the github push event" fi From 9f4942d7e0f36a7ab049e0c582c32e9c5f4f6e58 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 9 Oct 2025 12:48:20 -0700 Subject: [PATCH 06/13] feat: generate documentation only on tag push --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 55ed41ba6a..649c42a3a1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -218,6 +218,7 @@ jobs: generate-documentation: runs-on: ubuntu-latest needs: [build-and-lint, unit, integration, browser] + if: startsWith(github.ref, 'refs/tags/xrpl@') strategy: matrix: From 20969133245ccf319a801e7f09857054d05e73e3 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 9 Oct 2025 13:01:35 -0700 Subject: [PATCH 07/13] shift the tag pattern matching check into generate-documentation workflow --- .github/workflows/nodejs.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 649c42a3a1..e6a8b92ad5 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -279,14 +279,6 @@ jobs: runs-on: ubuntu-latest needs: generate-documentation steps: - - name: Detect version tag - id: check-tag - run: | - if [[ ${{ github.event.ref }} =~ ^refs/tags/xrpl@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "published_version_tag=true" >> $GITHUB_OUTPUT - echo "version tag detected in the github push event" - fi - name: Deploy to Documentation to GitHub Pages id: docs-artifact - if: steps.check-tag.outputs.published_version_tag == 'true' uses: actions/deploy-pages@v4 From bdbfdd30742af223c5a6b10ec77409be0bdab290 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 9 Oct 2025 13:18:23 -0700 Subject: [PATCH 08/13] update CONTRIBUTING instructions --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2fa8f54d5..7c12a27ec8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -241,7 +241,7 @@ Note: The same updated config can be used to update xrpl-py's CI as well. - [ ] Update the version number and release date, and ensure it lists the changes since the previous release. -4. (This step is performed by `generate-documentation` nodejs.yml Github Actions workflow) Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta). +4. (This step is performed by `generate-documentation` nodejs.yml Github Actions workflow. This is not required to be done manually) Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta). 5. Run `npm run clean` to delete previously generated artifacts. 6. Run `npm run build` to triple check the build still works 7. Run `npx lerna version --no-git-tag-version` - This bumps the package versions. @@ -265,7 +265,7 @@ Note: The same updated config can be used to update xrpl-py's CI as well. 13. Run `git tag -m `, where `` is the new package and version (e.g. `xrpl@2.1.1`), for each version released. 14. Run `git push --follow-tags`, to push the tags to Github. -Note: Pushing a tag in the format of `vA.B.C` triggers the `deploy-docs-pages` workflow in the `nodejs.yml` Github Actions workflow. This updates the documentation in js.xrpl.org to match the code changes in the checked out git branch. +Note: Pushing a tag in the format of `xrpl@A.B.C` triggers the `generate-documentation` and `deploy-docs-pages` workflow in the `nodejs.yml` Github Actions workflow. This updates the documentation in js.xrpl.org to match the code changes in the checked out git branch. 15. On GitHub, click the "Releases" link on the right-hand side of the page. From e8b612b8658ecad4f5b2daa4632e53065d562fd0 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 17 Oct 2025 13:49:20 -0700 Subject: [PATCH 09/13] refactor: migrate docs generation and publish step into the Release workflow --- .github/workflows/generate-documentation.yml | 77 ++++++++++++++++++++ .github/workflows/nodejs.yml | 68 ----------------- .github/workflows/release.yml | 11 +++ 3 files changed, 88 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/generate-documentation.yml diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml new file mode 100644 index 0000000000..edf760884d --- /dev/null +++ b/.github/workflows/generate-documentation.yml @@ -0,0 +1,77 @@ +name: Generate Documentation + +on: + workflow_call: + inputs: + git_ref: + description: 'Git ref to checkout (branch, tag, or commit SHA)' + required: true + type: string + +env: + GIT_REF: ${{ inputs.git_ref }} + +jobs: + generate-documentation: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22.x] + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ env.GIT_REF }} + fetch-depth: 0 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup npm version 10 + run: | + npm i -g npm@10 --registry=https://registry.npmjs.org + - name: Cache node modules + id: cache-nodemodules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + # caching node_modules + path: | + node_modules + */*/node_modules + key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-deps-${{ matrix.node-version }}- + - name: Install Dependencies + if: steps.cache-nodemodules.outputs.cache-hit != 'true' + run: npm ci + + - run: npm run build + + - name: Generate Documentation + run: npm run docgen + + - name: Upload documentation files as artifact + id: docs-artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/ + retention-days: 10 + + deploy-docs-pages: + permissions: + id-token: write # Needed for OIDC authentication + pages: write # this permission is needed for deploying into Github Pages + environment: + name: github-pages + url: ${{ steps.docs-artifact.outputs.page_url }} + runs-on: ubuntu-latest + needs: generate-documentation + steps: + - name: Deploy to Documentation to GitHub Pages + id: docs-artifact + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e6a8b92ad5..3bcea56997 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -214,71 +214,3 @@ jobs: - name: Stop docker container if: always() run: docker stop rippled-service - - generate-documentation: - runs-on: ubuntu-latest - needs: [build-and-lint, unit, integration, browser] - if: startsWith(github.ref, 'refs/tags/xrpl@') - - strategy: - matrix: - node-version: [22.x] - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ env.GIT_REF }} - fetch-depth: 0 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Setup npm version 10 - run: | - npm i -g npm@10 --registry=https://registry.npmjs.org - - - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v4 - env: - cache-name: cache-node-modules - with: - # caching node_modules - path: | - node_modules - */*/node_modules - key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-deps-${{ matrix.node-version }}- - - - name: Install Dependencies - if: steps.cache-nodemodules.outputs.cache-hit != 'true' - run: npm ci - - - run: npm run build - - - name: Generate Documentation - run: npm run docgen - - - name: Upload documentation files as artifact - id: docs-artifact - uses: actions/upload-pages-artifact@v3 - with: - path: docs/ - retention-days: 10 - - deploy-docs-pages: - permissions: - id-token: write # Needed for OIDC authentication - pages: write # this permission is needed for deploying into Github Pages - environment: - name: github-pages - url: ${{ steps.docs-artifact.outputs.page_url }} - runs-on: ubuntu-latest - needs: generate-documentation - steps: - - name: Deploy to Documentation to GitHub Pages - id: docs-artifact - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5d0096b69..301470dd1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -630,3 +630,14 @@ jobs: --arg channel "#xrpl-js" \ --arg text "$MESSAGE" \ '{channel: $channel, text: $text}')" + + generate-documentation: + name: Generate and Publish documentation for ${{ needs.get_version.outputs.package_version }} + uses: ./.github/workflows/generate-documentation.yml + needs: [get_version, release] + with: + git_ref: ${{ github.event.inputs.release_branch }} + permissions: + contents: read + id-token: write + pages: write From 646e6e144db7a2dc35480b576368a1f80447eb4f Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 17 Oct 2025 14:21:49 -0700 Subject: [PATCH 10/13] feat: Introduce conditional trigger of docs generation; Docs are generated only for npm_dist_tag == latest (official non-beta releases) --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05ded374da..af9f73d07f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -635,6 +635,7 @@ jobs: generate-documentation: name: Generate and Publish documentation for ${{ needs.get_version.outputs.package_version }} + if: ${{ github.event.inputs.npmjs_dist_tag == 'latest' }} uses: ./.github/workflows/generate-documentation.yml needs: [get_version, release] with: From e654a5ac32e65ccadb3425ba35d87c903e0bf1e8 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 17 Oct 2025 14:25:00 -0700 Subject: [PATCH 11/13] remove the manual instructions for updating the docs --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c12a27ec8..4a96c1af4d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -241,7 +241,6 @@ Note: The same updated config can be used to update xrpl-py's CI as well. - [ ] Update the version number and release date, and ensure it lists the changes since the previous release. -4. (This step is performed by `generate-documentation` nodejs.yml Github Actions workflow. This is not required to be done manually) Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta). 5. Run `npm run clean` to delete previously generated artifacts. 6. Run `npm run build` to triple check the build still works 7. Run `npx lerna version --no-git-tag-version` - This bumps the package versions. From d2ee547adbe61c28343dfb1151c28c298dc09555 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 17 Oct 2025 14:41:34 -0700 Subject: [PATCH 12/13] feat: eliminate the usage of github.inputs.branch_name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af9f73d07f..4a1630f846 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -639,7 +639,7 @@ jobs: uses: ./.github/workflows/generate-documentation.yml needs: [get_version, release] with: - git_ref: ${{ github.event.inputs.release_branch }} + git_ref: ${{ github.ref_name }} permissions: contents: read id-token: write From 4c14207e9b62c9e634ebf7e1b55aadf467a73c20 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 17 Oct 2025 14:44:01 -0700 Subject: [PATCH 13/13] update the instructions on contributing doc --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a96c1af4d..541d956f6b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -264,7 +264,6 @@ Note: The same updated config can be used to update xrpl-py's CI as well. 13. Run `git tag -m `, where `` is the new package and version (e.g. `xrpl@2.1.1`), for each version released. 14. Run `git push --follow-tags`, to push the tags to Github. -Note: Pushing a tag in the format of `xrpl@A.B.C` triggers the `generate-documentation` and `deploy-docs-pages` workflow in the `nodejs.yml` Github Actions workflow. This updates the documentation in js.xrpl.org to match the code changes in the checked out git branch. 15. On GitHub, click the "Releases" link on the right-hand side of the page.