From 11f13d0360c1b3ea7c30798ba150d59bc3c0edea Mon Sep 17 00:00:00 2001 From: Dimasik Kolezhniuk Date: Mon, 15 Apr 2024 14:07:43 +0200 Subject: [PATCH 1/2] Add workflow of publishing package to NPM --- .github/workflows/npm-publish.yml | 21 +++++++++++++++++++++ .nvmrc | 1 + 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .nvmrc diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..77fc784 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,21 @@ +name: Publish package to NPM + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: https://registry.npmjs.org/ + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.IDEN3_CIRCOM_NPM_PUBLISH_TOKEN}} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..ee09fac --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.11.1 From 55564d963dc4992b76977a9275051525ca0a26ea Mon Sep 17 00:00:00 2001 From: Dimasik Kolezhniuk Date: Mon, 15 Apr 2024 16:14:46 +0200 Subject: [PATCH 2/2] Remove nvmrc --- .github/workflows/npm-publish.yml | 2 +- .nvmrc | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .nvmrc diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 77fc784..20c6203 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version: '20.x' registry-url: https://registry.npmjs.org/ cache: 'npm' - run: npm ci diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index ee09fac..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v20.11.1