From 6a81a9f49dd004ca51989258d0010c593a5b5be0 Mon Sep 17 00:00:00 2001 From: 0xZensh Date: Tue, 16 Jul 2024 14:14:58 +0800 Subject: [PATCH] chore: add npm publishing to action --- .github/workflows/publish-crates.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 04e3f2c..2ea4a42 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -7,8 +7,20 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - ignore-unpublished-changes: true + - uses: actions/checkout@v4 + - uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + ignore-unpublished-changes: true + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: | + cd src/ic_oss_ts + npm install + npm test + npm build + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}