From e1e6655ff277eee215947ff87d13e6bb119993de Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Thu, 27 Feb 2025 15:42:53 -0800 Subject: [PATCH] Set up CI publishing pipeline to NPM --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .gitignore | 3 +++ .npmignore | 4 ++++ 3 files changed, 40 insertions(+) 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..337d9c0 --- /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/.gitignore b/.gitignore index 61461dd..8693088 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ node_modules # Local-only local + +# `clangd` cache files +.cache diff --git a/.npmignore b/.npmignore index ae3061f..cd8e6cc 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,7 @@ # See the root package.json's "files" for what is included. # npm5 ignores empty .npmignore files so add something trivial. /node_modules +.travis.yml +.last-synced-commit +.github +npm-debug.log