From c3cd44f0d8d8266951c3f71685195f692284cc46 Mon Sep 17 00:00:00 2001 From: Erel Segal-Halevi Date: Mon, 19 Jun 2023 20:34:01 +0300 Subject: [PATCH] feat: automatically publish to npm --- .github/workflows/publish.yml | 23 +++++++++++++++++++++++ .releaserc | 15 +++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .releaserc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e44fa19 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Semantic Release + +on: + push: + branches: [ master ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: | + npm ci + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..0ec0fae --- /dev/null +++ b/.releaserc @@ -0,0 +1,15 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + ["@semantic-release/changelog", { + "changelogFile": "CHANGELOG.md" + }], + "@semantic-release/npm", + "@semantic-release/github", + ["@semantic-release/git", { + "assets": ["package.json", "package-lock.json", "LICENSE", "README.md", "CHANGELOG.md"], + "message": "chore: release ${nextRelease.version} :tada: [skip ci]\n\n${nextRelease.notes}" + }] + ] +} \ No newline at end of file