Skip to content

Commit 32c25a0

Browse files
committed
Merge branch 'main' of github.com:XRPLF/xrpl.js into lending-protocol-xls-66d
2 parents 2e97b06 + 3fb9c94 commit 32c25a0

File tree

11 files changed

+155
-120
lines changed

11 files changed

+155
-120
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Generate Documentation
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
git_ref:
7+
description: 'Git ref to checkout (branch, tag, or commit SHA)'
8+
required: true
9+
type: string
10+
11+
env:
12+
GIT_REF: ${{ inputs.git_ref }}
13+
14+
jobs:
15+
generate-documentation:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [22.x]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
ref: ${{ env.GIT_REF }}
26+
fetch-depth: 0
27+
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
33+
- name: Setup npm version 10
34+
run: |
35+
npm i -g npm@10 --registry=https://registry.npmjs.org
36+
- name: Cache node modules
37+
id: cache-nodemodules
38+
uses: actions/cache@v4
39+
env:
40+
cache-name: cache-node-modules
41+
with:
42+
# caching node_modules
43+
path: |
44+
node_modules
45+
*/*/node_modules
46+
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-deps-${{ matrix.node-version }}-
49+
- name: Install Dependencies
50+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
51+
run: npm ci
52+
53+
- run: npm run build
54+
55+
- name: Generate Documentation
56+
run: npm run docgen
57+
58+
- name: Upload documentation files as artifact
59+
id: docs-artifact
60+
uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: docs/
63+
retention-days: 10
64+
65+
deploy-docs-pages:
66+
permissions:
67+
id-token: write # Needed for OIDC authentication
68+
pages: write # this permission is needed for deploying into Github Pages
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.docs-artifact.outputs.page_url }}
72+
runs-on: ubuntu-latest
73+
needs: generate-documentation
74+
steps:
75+
- name: Deploy to Documentation to GitHub Pages
76+
id: docs-artifact
77+
uses: actions/deploy-pages@v4

.github/workflows/nodejs.yml

Lines changed: 4 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
timeout-minutes: 10
2828
strategy:
2929
matrix:
30-
node-version: [22.x]
30+
node-version: [24.x]
3131

3232
steps:
3333
- uses: actions/checkout@v4
@@ -70,7 +70,7 @@ jobs:
7070

7171
strategy:
7272
matrix:
73-
node-version: [20.x, 22.x]
73+
node-version: [20.x, 22.x, 24.x]
7474

7575
steps:
7676
- uses: actions/checkout@v4
@@ -113,7 +113,7 @@ jobs:
113113

114114
strategy:
115115
matrix:
116-
node-version: [20.x, 22.x]
116+
node-version: [20.x, 22.x, 24.x]
117117

118118
steps:
119119
- uses: actions/checkout@v4
@@ -167,7 +167,7 @@ jobs:
167167

168168
strategy:
169169
matrix:
170-
node-version: [22.x]
170+
node-version: [24.x]
171171

172172
steps:
173173
- uses: actions/checkout@v4
@@ -214,79 +214,3 @@ jobs:
214214
- name: Stop docker container
215215
if: always()
216216
run: docker stop rippled-service
217-
218-
generate-documentation:
219-
runs-on: ubuntu-latest
220-
221-
strategy:
222-
matrix:
223-
node-version: [22.x]
224-
225-
steps:
226-
- uses: actions/checkout@v4
227-
with:
228-
ref: ${{ env.GIT_REF }}
229-
fetch-depth: 0
230-
231-
- name: Use Node.js ${{ matrix.node-version }}
232-
uses: actions/setup-node@v4
233-
with:
234-
node-version: ${{ matrix.node-version }}
235-
236-
- name: Setup npm version 10
237-
run: |
238-
npm i -g npm@10 --registry=https://registry.npmjs.org
239-
240-
- name: Cache node modules
241-
id: cache-nodemodules
242-
uses: actions/cache@v4
243-
env:
244-
cache-name: cache-node-modules
245-
with:
246-
# caching node_modules
247-
path: |
248-
node_modules
249-
*/*/node_modules
250-
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
251-
restore-keys: |
252-
${{ runner.os }}-deps-${{ matrix.node-version }}-
253-
254-
- name: Install Dependencies
255-
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
256-
run: npm ci
257-
258-
- run: npm run build
259-
260-
- name: Generate Documentation
261-
run: npm run docgen
262-
263-
- name: Upload documentation files as artifact
264-
id: docs-artifact
265-
uses: actions/upload-pages-artifact@v3
266-
with:
267-
path: docs/
268-
retention-days: 10
269-
270-
deploy-docs-pages:
271-
permissions:
272-
id-token: write # Needed for OIDC authentication
273-
pages: write # this permission is needed for deploying into Github Pages
274-
environment:
275-
name: github-pages
276-
url: ${{ steps.docs-artifact.outputs.page_url }}
277-
runs-on: ubuntu-latest
278-
needs: generate-documentation
279-
# Deploy docs only pushes into the main branch
280-
if: success() && github.ref == 'refs/heads/main'
281-
steps:
282-
- name: Detect (non-beta) version tag
283-
id: check-tag
284-
run: |
285-
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
286-
echo "published_version_tag=true" >> $GITHUB_OUTPUT
287-
fi
288-
289-
- name: Deploy to Documentation to GitHub Pages
290-
id: docs-artifact
291-
if: steps.check-tag.outputs.published_version_tag == 'true'
292-
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
package_name:
1010
description: 'Package folder (Name of the package directory under packages/ folder. e.g., xrpl, ripple-address-codec)'
1111
required: true
12-
release_branch:
13-
description: 'Release branch the release is generated from'
14-
required: true
1512
npmjs_dist_tag:
1613
description: 'npm distribution tag(Read more https://docs.npmjs.com/adding-dist-tags-to-packages)'
1714
default: 'latest'
@@ -30,12 +27,21 @@ jobs:
3027
- name: Checkout code
3128
uses: actions/checkout@v4
3229
with:
33-
ref: ${{ github.event.inputs.release_branch }}
3430
fetch-depth: 0
3531

3632
- name: Validate inputs
3733
run: |
3834
set -euo pipefail
35+
RELEASE_BRANCH="$(git branch --show-current || true)"
36+
if [[ -z "$RELEASE_BRANCH" ]]; then
37+
RELEASE_BRANCH="${{ github.ref_name }}"
38+
fi
39+
40+
if [[ -z "$RELEASE_BRANCH" ]]; then
41+
echo "❌ Unable to determine branch name." >&2
42+
exit 1
43+
fi
44+
3945
# Validate package_name
4046
PKG_NAME="${{ github.event.inputs.package_name }}"
4147
if ! [[ "$PKG_NAME" =~ ^[a-z0-9][a-z0-9-]*$ ]]; then
@@ -47,10 +53,9 @@ jobs:
4753
echo "❌ package_name must be a single directory under packages/." >&2
4854
exit 1
4955
fi
50-
if git ls-remote --exit-code origin "refs/heads/${{ github.event.inputs.release_branch }}" > /dev/null; then
51-
echo "✅ Found release branch: ${{ github.event.inputs.release_branch }}"
52-
else
53-
echo "❌ Release branch ${{ github.event.inputs.release_branch }} not found in remote. Failing workflow."
56+
57+
if [[ ! "${RELEASE_BRANCH,,}" =~ ^release[-/] ]]; then
58+
echo "❌ Release branch '$RELEASE_BRANCH' must start with 'release-' or 'release/'." >&2
5459
exit 1
5560
fi
5661
@@ -115,7 +120,7 @@ jobs:
115120
needs: [get_version]
116121
uses: ./.github/workflows/faucet_test.yml
117122
with:
118-
git_ref: ${{ github.event.inputs.release_branch }}
123+
git_ref: ${{ github.ref }}
119124
secrets: inherit
120125

121126
run_tests:
@@ -127,7 +132,7 @@ jobs:
127132
needs: [get_version]
128133
uses: ./.github/workflows/nodejs.yml
129134
with:
130-
git_ref: ${{ github.event.inputs.release_branch }}
135+
git_ref: ${{ github.ref }}
131136
secrets: inherit
132137

133138
pre_release:
@@ -143,7 +148,6 @@ jobs:
143148
- name: Checkout code
144149
uses: actions/checkout@v4
145150
with:
146-
ref: ${{ github.event.inputs.release_branch }}
147151
fetch-depth: 0
148152

149153
- name: Set up Node.js
@@ -199,7 +203,9 @@ jobs:
199203
run: |
200204
curl -X POST \
201205
-H "X-Api-Key: ${{ secrets.OWASP_TOKEN }}" \
202-
-F "project=7c40c8ea-ea0f-4a5f-9b9f-368e53232397" \
206+
-F "autoCreate=true" \
207+
-F "projectName=xrpl-js" \
208+
-F "projectVersion=${{ env.PACKAGE_VERSION }}" \
203209
204210
https://owasp-dt-api.prod.ripplex.io/api/v1/bom
205211
@@ -245,7 +251,7 @@ jobs:
245251
REPO: ${{ github.repository }}
246252
PKG_NAME: ${{ env.PACKAGE_NAME }}
247253
PKG_VER: ${{ env.PACKAGE_VERSION }}
248-
REL_BRANCH: ${{ github.event.inputs.release_branch }}
254+
REL_BRANCH: ${{ github.ref_name }}
249255
VULN_ART_URL: ${{ steps.vuln_art.outputs.art_url }}
250256
LABELS: security
251257
run: |
@@ -294,10 +300,11 @@ jobs:
294300
needs: [get_version, run_faucet_test, run_tests, pre_release]
295301
permissions:
296302
pull-requests: write
297-
name: Review test and security scan result -- Dev team
303+
name: Print Test/Security scan result and invite Dev team to review
298304
env:
299305
PACKAGE_VERSION: "${{ needs.get_version.outputs.package_version }}"
300306
PACKAGE_NAME: "${{ github.event.inputs.package_name }}"
307+
RELEASE_BRANCH: "${{ github.ref_name }}"
301308
outputs:
302309
reviewers_dev: ${{ steps.get_reviewers.outputs.reviewers_dev }}
303310
reviewers_sec: ${{ steps.get_reviewers.outputs.reviewers_sec }}
@@ -306,15 +313,14 @@ jobs:
306313
- name: Checkout code
307314
uses: actions/checkout@v4
308315
with:
309-
ref: ${{ github.event.inputs.release_branch }}
310316
fetch-depth: 0
311317
- name: Create PR from release branch to main (skips for rc/beta)
312318
id: ensure_pr
313319
if: ${{ github.event.inputs.npmjs_dist_tag == '' || github.event.inputs.npmjs_dist_tag == 'latest' }}
314320
env:
315321
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
316322
REPO: ${{ github.repository }}
317-
RELEASE_BRANCH: ${{ github.event.inputs.release_branch }}
323+
RELEASE_BRANCH: ${{ github.ref_name }}
318324
VERSION: ${{ needs.get_version.outputs.package_version }}
319325
run: |
320326
set -euo pipefail
@@ -423,7 +429,6 @@ jobs:
423429
run: |
424430
set -euo pipefail
425431
ARTIFACT_NAME="vulnerability-report"
426-
RELEASE_BRANCH="${{ github.event.inputs.release_branch }}"
427432
COMMIT_SHA="$(git rev-parse --short HEAD)"
428433
429434
echo "Fetching artifact ID for ${ARTIFACT_NAME}..."
@@ -487,14 +492,13 @@ jobs:
487492
ask_for_sec_team_review:
488493
runs-on: ubuntu-latest
489494
needs: [get_version, run_faucet_test, run_tests, pre_release, ask_for_dev_team_review, first_review]
490-
name: Review test and security scan result — Sec team
495+
name: Invite sec team to review
491496
steps:
492497
- name: Send Sec team review request to Slack
493498
shell: bash
494499
env:
495500
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
496-
CHANNEL: "#xrpl-js"
497-
501+
CHANNEL: "#ripplex-security"
498502
EXECUTOR: ${{ github.triggering_actor || github.actor }}
499503
PACKAGE_NAME: ${{ needs.get_version.outputs.package_version && github.event.inputs.package_name }}
500504
PACKAGE_VERSION: ${{ needs.get_version.outputs.package_version }}
@@ -517,7 +521,7 @@ jobs:
517521
id-token: write
518522
contents: write
519523
needs: [get_version, run_faucet_test, run_tests, pre_release, ask_for_dev_team_review, first_review, ask_for_sec_team_review]
520-
name: Release Pipeline for ${{ needs.get_version.outputs.package_version }}
524+
name: Release for ${{ needs.get_version.outputs.package_version }}
521525
env:
522526
PACKAGE_VERSION: "${{ needs.get_version.outputs.package_version }}"
523527
PACKAGE_NAME: "${{ github.event.inputs.package_name }}"
@@ -534,7 +538,6 @@ jobs:
534538
- name: Checkout code
535539
uses: actions/checkout@v4
536540
with:
537-
ref: ${{ github.event.inputs.release_branch }}
538541
fetch-depth: 0
539542

540543
- name: Download artifact
@@ -622,11 +625,23 @@ jobs:
622625
env:
623626
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
624627
run: |
625-
MESSAGE="❌ Tests failed for xrpl.js ${{ env.PACKAGE_VERSION }}. Check the logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
628+
MESSAGE="❌ Release failed for ${{ env.PACKAGE_NAME }}@${{ env.PACKAGE_VERSION }}. Check the logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
626629
curl -X POST https://slack.com/api/chat.postMessage \
627630
-H "Authorization: Bearer $SLACK_TOKEN" \
628631
-H "Content-Type: application/json" \
629632
-d "$(jq -n \
630633
--arg channel "#xrpl-js" \
631634
--arg text "$MESSAGE" \
632635
'{channel: $channel, text: $text}')"
636+
637+
generate-documentation:
638+
name: Generate and Publish documentation for ${{ needs.get_version.outputs.package_version }}
639+
if: ${{ github.event.inputs.npmjs_dist_tag == 'latest' }}
640+
uses: ./.github/workflows/generate-documentation.yml
641+
needs: [get_version, release]
642+
with:
643+
git_ref: ${{ github.ref_name }}
644+
permissions:
645+
contents: read
646+
id-token: write
647+
pages: write

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ Note: The same updated config can be used to update xrpl-py's CI as well.
241241

242242
- [ ] Update the version number and release date, and ensure it lists the changes since the previous release.
243243

244-
4. Run `npm run docgen` if the docs were modified in this release to update them (skip this step for a beta).
245244
5. Run `npm run clean` to delete previously generated artifacts.
246245
6. Run `npm run build` to triple check the build still works
247246
7. Run `npx lerna version --no-git-tag-version` - This bumps the package versions.
@@ -265,6 +264,7 @@ Note: The same updated config can be used to update xrpl-py's CI as well.
265264

266265
13. Run `git tag <tagname> -m <tagname>`, where `<tagname>` is the new package and version (e.g. `[email protected]`), for each version released.
267266
14. Run `git push --follow-tags`, to push the tags to Github.
267+
268268
15. On GitHub, click the "Releases" link on the right-hand side of the page.
269269

270270
16. Repeat for each release:

0 commit comments

Comments
 (0)