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