From 315adcbf9ee5371ec32e49e0d2623a755f7b7882 Mon Sep 17 00:00:00 2001 From: Harold <75729237+surelle-ha@users.noreply.github.com> Date: Sun, 17 Nov 2024 15:09:00 +0800 Subject: [PATCH] Feature: NPM Registry Action (#2) * fix: error handles --- .github/workflows/npm-registry.yml | 36 ++++++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/npm-registry.yml diff --git a/.github/workflows/npm-registry.yml b/.github/workflows/npm-registry.yml new file mode 100644 index 0000000..ab2232d --- /dev/null +++ b/.github/workflows/npm-registry.yml @@ -0,0 +1,36 @@ +name: "⚡ NPM Registry" + +on: + push: + branches: + - main + +jobs: + publish-package: + permissions: + contents: read + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org/" + + - name: Configure npm Authentication + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Install Dependencies + run: npm install + + - name: Build Package + run: npm run build + + - name: Publish Package + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 99cf4ad..6e0d1a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@surelle-ha/blitz", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@surelle-ha/blitz", - "version": "1.0.0", + "version": "1.0.2", "license": "ISC", "dependencies": { "@nestjs/common": "^10.4.8", diff --git a/package.json b/package.json index 2d25173..8732f1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@surelle-ha/blitz", - "version": "1.0.0", + "version": "1.0.2", "description": "A boilerplate for NestJS Packages.", "main": "dist/index.js", "types": "dist/index.d.ts",