From 4e5ecff0b2ebf7bf03d7e977fd2d0564bc255695 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Mon, 13 Feb 2023 18:02:13 -0500 Subject: [PATCH] fix: try this approach to lifecycle events --- .releaserc.yml | 18 ++++++++++++------ package.json | 1 - 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.releaserc.yml b/.releaserc.yml index 184315447..fa177a3ee 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -9,6 +9,9 @@ plugins: - '@semantic-release/commit-analyzer' - ['@semantic-release/release-notes-generator', { 'writerOpts': { 'commitsSort': ['subject', 'scope'] } }] - '@semantic-release/changelog' + # `npm` must be before `git` so the `npm` command can properly bump + # the package*.json files before we commit the changes + - '@semantic-release/npm' - [ '@semantic-release/git', { @@ -19,10 +22,13 @@ plugins: message: "build(release): 🚀 v${nextRelease.version} 🦉\n\n${nextRelease.notes}\n[skip release ci]", }, ] - # `npm` must be after `git` because we need the `prepare`step of the `git` plugin - # to execute first so it can create the build commit since we do some add'l tagging - # in the `postversion` npm hook - - '@semantic-release/npm' - # Lightweight alternative to `@semantic-release/github` that creates a draft release - - ['@semantic-release/exec', { 'publishCmd': 'gh release create ${nextRelease.version} --draft --generate-notes' }] + - [ + '@semantic-release/exec', + { + # Adds a couple extra tags as aliases for our GitHub Actions users + 'prepareCmd': 'git tag ${nextRelease.version} && ./bin/set-major-version-tag.js', + # Lightweight alternative to `@semantic-release/github` that creates a draft release + 'publishCmd': 'gh release create ${nextRelease.version} --draft --generate-notes', + }, + ] # dryRun: true # TODO: remove this diff --git a/package.json b/package.json index aab489c02..230253d11 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,6 @@ "build": "tsc", "debug": "ts-node src/cli.ts", "lint": "eslint . bin/rdme --ext .js,.ts", - "postversion": "git tag $npm_package_version && ./bin/set-major-version-tag.js", "prebuild": "rm -rf dist/", "prepack": "npm run build", "prepare": "husky install",