diff --git a/README.md b/README.md index 68534c8..5e63b1e 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,8 @@ Keep one of `files` or `main` keys in your `package.json` accurate depending on If you publish, make sure to also provide a valid `NPM_TOKEN` as `.npmrc` authentication is ignored in our config! +To configure the directory for publishing, you have the option to set a path value to `NPM_PACKAGE_ROOT`. By default, it is set to `"."`. + ### GitHub Actions Unless you have an `action.yml` present in your root folder, this module is not added to the release config. diff --git a/release.config.js b/release.config.js index d40c10b..765eb5c 100644 --- a/release.config.js +++ b/release.config.js @@ -39,6 +39,7 @@ const { GIT_COMMITTER_EMAIL, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, + NPM_PACKAGE_ROOT } = process.env; const [owner, repo] = String(GITHUB_REPOSITORY).toLowerCase().split("/"); const addPlugin = (plugin, options) => { @@ -56,7 +57,7 @@ try { authorName && !GIT_AUTHOR_NAME && (process.env.GIT_AUTHOR_NAME = `${authorName}`); authorEmail && !GIT_AUTHOR_EMAIL && (process.env.GIT_AUTHOR_EMAIL = `${authorEmail}`); } catch (e) { - log.warn(`Unable to set GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL`); + log.warn(`Unable to set GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL`); log.error(e); } @@ -117,8 +118,10 @@ addPlugin("@semantic-release/changelog", { > All notable changes to this project will be documented in this file` }); +const pkgRoot = NPM_PACKAGE_ROOT || "."; addPlugin("@semantic-release/npm", { - "tarballDir": "pack" + tarballDir: "pack", + pkgRoot, }); const actionExists = existsSync("./action.yml"); @@ -170,6 +173,11 @@ addPlugin("@semantic-release/git", { "npm-shrinkwrap.json", "yarn.lock", "pnpm-lock.yaml", + "**/package.json", + "**/package-lock.json", + "**/npm-shrinkwrap.json", + "**/yarn.lock", + "**/pnpm-lock.yaml", "public/**/*", "supabase/**/*", "action.yml",