From 6ddc4ce721b4e30b0cd5536c0e0109bb11d62639 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:36:46 +0100 Subject: [PATCH 1/9] github ci that publishes to npm registry --- .github/workflows/npm_publish.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/npm_publish.yml diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml new file mode 100644 index 000000000..8b4b1e1e1 --- /dev/null +++ b/.github/workflows/npm_publish.yml @@ -0,0 +1,50 @@ +--- +# Publishing all NPM packages to the npm registry when the version number changes +# See https://github.com/marketplace/actions/npm-publish for more information +name: Publish Packages to npmjs + +on: + push: + branches: development + +jobs: + # Publish the TypeScript bindings to the NPM registry + publish-typescript-bindings: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./bindings + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20" + - run: npm ci + - run: npm test + - uses: JS-DevTools/npm-publish@v3 + id: publish + with: + token: ${{ secrets.NPM_TOKEN }} + - if: ${{ steps.publish.outputs.type }} + run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" + + # Publish the Tari Wallet Daemon client to the NPM registry + publish-wallet-daemon-client: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./clients/javascript/wallet_daemon_client + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20" + - run: npm ci + - run: npm test + - uses: JS-DevTools/npm-publish@v3 + id: publish + with: + token: ${{ secrets.NPM_TOKEN }} + - if: ${{ steps.publish.outputs.type }} + run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" + From 6b725a73adb2d51c17adc5757d56fccdf83c9ed6 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:16:16 +0100 Subject: [PATCH 2/9] run on PRs for testing --- .github/workflows/npm_publish.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 8b4b1e1e1..eb0248376 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -3,9 +3,18 @@ # See https://github.com/marketplace/actions/npm-publish for more information name: Publish Packages to npmjs +# TODO: after confirming that the action works, set the trigger on "development" branch commits instead of PRs +# on: +# push: +# branches: development + on: - push: - branches: development + pull_request: + types: + - opened + - reopened + - edited + - synchronize jobs: # Publish the TypeScript bindings to the NPM registry From 79d0ec246e9283b7f19cf2d6cf552bdcea7efc9c Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:18:04 +0100 Subject: [PATCH 3/9] remove npm test from ci --- .github/workflows/npm_publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index eb0248376..e6f9f5a87 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -29,7 +29,6 @@ jobs: with: node-version: "20" - run: npm ci - - run: npm test - uses: JS-DevTools/npm-publish@v3 id: publish with: From e9668afbac7584ab953af6c6fd6a0ced54d90641 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:43:43 +0100 Subject: [PATCH 4/9] remove npm test from ci --- .github/workflows/npm_publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index e6f9f5a87..11e0463cd 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -48,7 +48,6 @@ jobs: with: node-version: "20" - run: npm ci - - run: npm test - uses: JS-DevTools/npm-publish@v3 id: publish with: From e19c918b7f3cfee366872cc67cba4941aad7d6b3 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:57:25 +0100 Subject: [PATCH 5/9] trigger on development branch pushes --- .github/workflows/npm_publish.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 11e0463cd..c880ad205 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -3,18 +3,9 @@ # See https://github.com/marketplace/actions/npm-publish for more information name: Publish Packages to npmjs -# TODO: after confirming that the action works, set the trigger on "development" branch commits instead of PRs -# on: -# push: -# branches: development - on: - pull_request: - types: - - opened - - reopened - - edited - - synchronize + push: + branches: development jobs: # Publish the TypeScript bindings to the NPM registry From f374d5ced8a1bdcf40797b785e2669dbe192afc5 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:06:44 +0100 Subject: [PATCH 6/9] set up the package directory --- .github/workflows/npm_publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index c880ad205..6e42b6219 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./bindings + working-directory: bindings steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -24,6 +24,7 @@ jobs: id: publish with: token: ${{ secrets.NPM_TOKEN }} + package: bindings - if: ${{ steps.publish.outputs.type }} run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" @@ -32,7 +33,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./clients/javascript/wallet_daemon_client + working-directory: clients/javascript/wallet_daemon_client steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -43,6 +44,7 @@ jobs: id: publish with: token: ${{ secrets.NPM_TOKEN }} + package: clients/javascript/wallet_daemon_client - if: ${{ steps.publish.outputs.type }} run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" From 4f78ee39eec8299c9d8e7fa603ed5edd4fb9c750 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:21:40 +0100 Subject: [PATCH 7/9] bump typescript bindings version --- bindings/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/package.json b/bindings/package.json index 5586f71e8..6bb0e2732 100644 --- a/bindings/package.json +++ b/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@tariproject/typescript-bindings", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "index.ts", "scripts": { From 666fec2baaaf6daf9d773433466d551753082087 Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:37:02 +0100 Subject: [PATCH 8/9] improve npm publish ci --- .github/workflows/npm_publish.yml | 7 +------ clients/javascript/wallet_daemon_client/package.json | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 6e42b6219..beef0f241 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -21,16 +21,14 @@ jobs: node-version: "20" - run: npm ci - uses: JS-DevTools/npm-publish@v3 - id: publish with: token: ${{ secrets.NPM_TOKEN }} package: bindings - - if: ${{ steps.publish.outputs.type }} - run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" # Publish the Tari Wallet Daemon client to the NPM registry publish-wallet-daemon-client: runs-on: ubuntu-latest + needs: publish-typescript-bindings defaults: run: working-directory: clients/javascript/wallet_daemon_client @@ -41,10 +39,7 @@ jobs: node-version: "20" - run: npm ci - uses: JS-DevTools/npm-publish@v3 - id: publish with: token: ${{ secrets.NPM_TOKEN }} package: clients/javascript/wallet_daemon_client - - if: ${{ steps.publish.outputs.type }} - run: echo "Published to NPM registry '${{ steps.publish.outputs.name }}' version '${{ steps.publish.outputs.version }}'" diff --git a/clients/javascript/wallet_daemon_client/package.json b/clients/javascript/wallet_daemon_client/package.json index da27d2eb1..6dbdb354f 100644 --- a/clients/javascript/wallet_daemon_client/package.json +++ b/clients/javascript/wallet_daemon_client/package.json @@ -1,6 +1,6 @@ { "name": "@tariproject/wallet_jrpc_client", - "version": "1.0.5", + "version": "1.0.6", "description": "Tari wallet JSON-RPC client library", "scripts": { "build": "tsc", From 3d4fc724c21258d010e312ae53afb065639873cb Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:40:19 +0100 Subject: [PATCH 9/9] update bindings dep version in wallet client --- clients/javascript/wallet_daemon_client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/javascript/wallet_daemon_client/package.json b/clients/javascript/wallet_daemon_client/package.json index 6dbdb354f..b6e6e6a01 100644 --- a/clients/javascript/wallet_daemon_client/package.json +++ b/clients/javascript/wallet_daemon_client/package.json @@ -14,7 +14,7 @@ "author": "", "license": "ISC", "dependencies": { - "@tariproject/typescript-bindings": "1.0.1" + "@tariproject/typescript-bindings": "1.0.2" }, "devDependencies": { "typescript": "^5.3.3"