diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..0accffd --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,22 @@ +name: Publish package to npm +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 + with: + node-version: ${{ matrix.node }} + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/.gitignore b/.gitignore index 30f39e8..d968c99 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ /.parcel-cache /esm /test/node_modules +/test/package-lock.json +/test/test-builds