diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..c0a1bf2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish to npm + +on: + release: + types: [published] + +jobs: + publish: + name: Publish to npm + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: npm + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Run tests + run: npm test + + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore index 54da022..bc78c20 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,9 @@ example +nextjs-example react-portal-tooltip.gif .babelrc .travis.yml +.github index.html test tsconfig.json diff --git a/package.json b/package.json index f0eca84..9241181 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-portal-tooltip-upgraded", - "version": "2.7.2", + "version": "2.7.3", "description": "Awesome React tooltips", "main": "lib/index.js", "types": "lib/index.d.ts",