From 99c1dbb84147b80779082cb81812ea46c2e1c383 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Mon, 20 Jan 2025 23:03:37 -0800 Subject: [PATCH] Setup automated publishing to NPM --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .npmignore | 1 + package.json | 2 +- 3 files changed, 35 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..537d793 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: NPM Publish + +on: + release: + types: [created] + workflow_dispatch: + +env: + NODE_VERSION: 16 + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - run: npm ci + - run: npm test + + publish: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish diff --git a/.npmignore b/.npmignore index 63cf84a..1408091 100644 --- a/.npmignore +++ b/.npmignore @@ -4,3 +4,4 @@ spec .travis.yml .npmignore npm-debug.log +.github/ diff --git a/package.json b/package.json index 17dad26..e22aa88 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "less-cache", + "name": "@pulsar-edit/less-cache", "version": "2.0.1", "description": "Less compile cache", "main": "./src/less-cache",