From 892fd079a0461045e0cea28389a7f753567b9bd0 Mon Sep 17 00:00:00 2001 From: ishanjain28 Date: Fri, 3 Sep 2021 18:08:05 +0530 Subject: [PATCH] Added release drafter and auto publish configuration, Updated package.json with the pre publish commands --- .github/release-drafter.yml | 3 +++ .github/workflows/draft-release.yml | 17 +++++++++++++++++ .github/workflows/npm-publish.yml | 20 ++++++++++++++++++++ package.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/draft-release.yml create mode 100644 .github/workflows/npm-publish.yml 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)\"",