From fd0aae5f0c19e0ea13ff404f3653740b508d5a84 Mon Sep 17 00:00:00 2001 From: andres Date: Wed, 15 Nov 2023 17:07:26 +0100 Subject: [PATCH] add workflow to publish to npm --- .github/workflows/publish.yml | 29 +++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6045dbb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish to NPM +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Build lib + run: pnpm run build + - name: Publish package on NPM 📦 + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 31b50a2..b28c7b0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bundlers", + "name": "@ershisan99/lib-demo", "private": true, "version": "0.0.0", "main": "./dist/index.js",