diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..1e4a18e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,3 @@ +template: | + ## What’s Changed + $CHANGES diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 0000000..e94d707 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,17 @@ +name: draft-release + +on: + push: + branches: + - 'master' + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..8ae4cea --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,20 @@ +name: npm-publish + +on: + release: + types: [released] + +jobs: + npm-publish: + name: npm-publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_AUTH_TOKEN }} + access: public + check-version: true diff --git a/package.json b/package.json index e34963a..aab74ec 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "types": "dist/esm/src/index.d.ts", "sideEffects": false, "scripts": { + "prepublishOnly": "npm i && npm run build", "build": "rollup -c rollup.config.js", "dev": "rollup -w -c rollup.config.js", "lint": "prettier -c --parser typescript \"{src,__tests__,e2e}/**/*.[jt]s?(x)\"",