From a77845bb7879f222ece4a0f5307965ce6a118498 Mon Sep 17 00:00:00 2001 From: Matti Mokko Date: Thu, 16 Nov 2023 08:34:51 +0200 Subject: [PATCH] Add npm publish information Publish the package privately to only robocorp organization. --- .github/workflows/publish-node.yaml | 10 +++++++--- package-lock.json | 4 ++-- package.json | 9 ++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-node.yaml b/.github/workflows/publish-node.yaml index adce1e5..240d2f4 100644 --- a/.github/workflows/publish-node.yaml +++ b/.github/workflows/publish-node.yaml @@ -1,6 +1,9 @@ name: Publish Node Addon -on: [push] +on: + push: + tags: + - 'v*' jobs: build: @@ -53,7 +56,8 @@ jobs: uses: actions/setup-node@v2 with: node-version: '18' - registry-url: 'https://npm.pkg.github.com' + registry-url: 'https://npm.pkg.github.com/' + scope: '@robocorp' - name: Download all artifacts uses: actions/download-artifact@v2 @@ -70,4 +74,4 @@ jobs: - name: Publish to GitHub Packages run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f63e55e..8519332 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "native-certs", + "name": "@robocorp/native-certs", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "native-certs", + "name": "@robocorp/native-certs", "version": "0.1.0", "hasInstallScript": true, "license": "ISC", diff --git a/package.json b/package.json index 4a2c359..b89908e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,15 @@ { - "name": "native-certs", + "name": "@robocorp/native-certs", "version": "0.1.0", "description": "", "main": "index.node", + "module": "index.node", + "publishConfig": { + "access": "restricted" + }, + "files": [ + "target" + ], "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --",