From d57e37c893be5a07c09c4e6f2370c43f71ddc32a Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 26 Apr 2025 15:22:09 -0700 Subject: [PATCH] Add automated publishing workflow --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .npmignore | 2 +- package.json | 4 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) 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..aa04319 --- /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 --access public diff --git a/.npmignore b/.npmignore index 5247f5d..94fadd6 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,7 @@ node_modules/ src/ template/ test/ -.github/ISSUE_TEMPLATE.md +.github/ .gitignore .npmignore .travis.yml diff --git a/package.json b/package.json index 20341f6..05f7422 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "license": "ISC", "name": "document-register-element", "description": "A stand-alone working lightweight version of the W3C Custom Elements specification", - "homepage": "https://github.com/WebReflection/document-register-element", + "homepage": "https://github.com/pulsar-edit/document-register-element", "keywords": [ "Builtin", "Components", @@ -25,7 +25,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/WebReflection/document-register-element.git" + "url": "git://github.com/pulsar-edit/document-register-element.git" }, "main": "./build/document-register-element.node.js", "module": "./build/document-register-element.js",