From d5ce98885540e869457f0ca618cb1c40db5e1d24 Mon Sep 17 00:00:00 2001 From: Aaditya Bhatia Date: Thu, 27 Jul 2023 00:19:04 -0400 Subject: [PATCH] github action: publish to npm --- .github/workflows/npm.yaml | 21 +++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 3 +-- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/npm.yaml diff --git a/.github/workflows/npm.yaml b/.github/workflows/npm.yaml new file mode 100644 index 0000000..39f880a --- /dev/null +++ b/.github/workflows/npm.yaml @@ -0,0 +1,21 @@ +name: Publish to npmjs + +on: + push: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: npm ci + - uses: JS-DevTools/npm-publish@v2.2.1 + with: + token: ${{ secrets.NPM_TOKEN }} + access: public diff --git a/package-lock.json b/package-lock.json index 17683c2..dad3a6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "replay-ranger", + "name": "@corsaircoalition/replay-ranger", "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "replay-ranger", + "name": "@corsaircoalition/replay-ranger", "version": "2.0.0", "dependencies": { "@corsaircoalition/common": "^1.1.0", diff --git a/package.json b/package.json index 2f030db..bec3d5e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { - "name": "replay-ranger", + "name": "@corsaircoalition/replay-ranger", "version": "2.0.0", "description": "record and replay generals.io game updates to Redis", - "private": true, "main": "out/index.js", "type": "module", "dependencies": {