diff --git a/packages/config-eslint/project.json b/packages/config-eslint/project.json index 7334e9e..0d5f053 100644 --- a/packages/config-eslint/project.json +++ b/packages/config-eslint/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/config-prettier/project.json b/packages/config-prettier/project.json index 2ff1782..50fc4d1 100644 --- a/packages/config-prettier/project.json +++ b/packages/config-prettier/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/deepmerge/project.json b/packages/deepmerge/project.json index 1cdb905..9c7c1dd 100644 --- a/packages/deepmerge/project.json +++ b/packages/deepmerge/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/dummy/project.json b/packages/dummy/project.json index 2fef6e0..e0e80d3 100644 --- a/packages/dummy/project.json +++ b/packages/dummy/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/file/project.json b/packages/file/project.json index 933d9df..4104148 100644 --- a/packages/file/project.json +++ b/packages/file/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/get/project.json b/packages/get/project.json index 00d61a3..2440903 100644 --- a/packages/get/project.json +++ b/packages/get/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/github/project.json b/packages/github/project.json index 23815e4..fd66d65 100644 --- a/packages/github/project.json +++ b/packages/github/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/logger/project.json b/packages/logger/project.json index 300e40c..e0db22e 100644 --- a/packages/logger/project.json +++ b/packages/logger/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/merge/project.json b/packages/merge/project.json index a5b789a..5daf998 100644 --- a/packages/merge/project.json +++ b/packages/merge/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/nx-yarn-deploy/src/executors/deploy/executor.ts b/packages/nx-yarn-deploy/src/executors/deploy/executor.ts index dd30f75..79f47ee 100644 --- a/packages/nx-yarn-deploy/src/executors/deploy/executor.ts +++ b/packages/nx-yarn-deploy/src/executors/deploy/executor.ts @@ -31,16 +31,33 @@ export default async function runExecutor( options.access ?? 'restricted' }`; - const { stdout, stderr } = await promisify(exec)(publishCommand, { + const { stdout: publishStdout, stderr: publishStderr } = await promisify( + exec + )(publishCommand, { cwd: projectFolder, }); - if (stderr) { - logError(stderr); + if (publishStderr) { + logError(publishStderr); return { success: false }; } - log('Release', stdout); + log('Release', publishStdout); + + const gitPushCommand = `git push --atomic --follow-tags`; + + const { stdout: gitPushStdout, stderr: gitPushStderr } = await promisify( + exec + )(gitPushCommand, { + cwd: projectFolder, + }); + + if (gitPushStderr) { + logError(gitPushStderr); + return { success: false }; + } + + log('Git push', gitPushStdout); return { success: true }; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/object/project.json b/packages/object/project.json index 0720120..776ad00 100644 --- a/packages/object/project.json +++ b/packages/object/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/tokenizer/project.json b/packages/tokenizer/project.json index 28b8364..86dd12b 100644 --- a/packages/tokenizer/project.json +++ b/packages/tokenizer/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": { diff --git a/packages/types/project.json b/packages/types/project.json index a831c75..a36e707 100644 --- a/packages/types/project.json +++ b/packages/types/project.json @@ -5,7 +5,7 @@ "version": { "executor": "@jscutlery/semver:version", "options": { - "postTargets": ["npm-publish", "git-push", "github-release"] + "postTargets": ["npm-publish", "github-release"] } }, "npm-publish": { @@ -15,12 +15,6 @@ "access": "public" } }, - "git-push": { - "executor": "nx:run-commands", - "options": { - "command": "git push --atomic --follow-tags" - } - }, "github-release": { "executor": "@jscutlery/semver:github", "options": {