diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf4ac29d..259c14a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -291,6 +291,36 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: npm publish --access public --ignore-scripts + publish-npm-adapters: + needs: publish-npm + runs-on: ubuntu-latest + environment: release + + defaults: + run: + working-directory: bindings/node-adapters + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + + - name: Set version from tag + run: | + V="${GITHUB_REF_NAME#v}" + "$GITHUB_WORKSPACE/scripts/set-version.sh" "$V" --node + + - name: Install dependencies + run: npm install --ignore-scripts + + - name: Publish adapters package + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access public --ignore-scripts + publish-crates: runs-on: ubuntu-latest environment: release diff --git a/scripts/set-version.sh b/scripts/set-version.sh index 9453ac64..6a3a1f1f 100755 --- a/scripts/set-version.sh +++ b/scripts/set-version.sh @@ -46,6 +46,11 @@ set_node_version() { npm install cargo update --workspace + + cd "$REPO_ROOT/bindings/node-adapters" + npm version "$VERSION" --no-git-tag-version --allow-same-version + jq --arg v "^$VERSION" '.dependencies["@open-wallet-standard/core"] = $v' \ + package.json > tmp.json && mv tmp.json package.json } set_rust_version() {