diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..1120a41 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,43 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Publish to NPM + +on: + release: + types: [created] +jobs: + build: + name: Build and Publish + timeout-minutes: 15 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.2 + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Publish package on NPM 📦 + run: cd ./lib && pnpm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/lib/package.json b/lib/package.json index 512660a..9c7dd67 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@hover-design/react", - "version": "0.1.5", + "version": "0.1.6", "description": "Hover Component library created by bunch of ants from antstack", "license": "MIT", "main": "dist/hover-react.es.js",