diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..986b863 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,32 @@ +name: Publish NPM package + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + run: | + npm ci + npm i -g npm@7 --registry=https://registry.npmjs.org + + - name: Build package + run: | + npm --no-git-tag-version version ${GITHUB_REF#refs/*/} + npm set-script prepare "" + npm run build + + - name: Publish build + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/package.json b/package.json index c4ca5ed..b92c399 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,5 @@ "lint-staged": "^12.4.1", "prettier": "^2.6.2", "typescript": "^4.6.4" - }, - "lint-staged": { - "*.{js,css,md}": "prettier --write" } }