Skip to content

Commit

Permalink
feat: add git push (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
devdigital authored Jan 10, 2024
1 parent 7fdc897 commit c5caee7
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 88 deletions.
8 changes: 1 addition & 7 deletions packages/config-eslint/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/config-prettier/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/deepmerge/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/dummy/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/file/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/get/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/github/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/logger/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/merge/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
25 changes: 21 additions & 4 deletions packages/nx-yarn-deploy/src/executors/deploy/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions packages/object/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/tokenizer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down
8 changes: 1 addition & 7 deletions packages/types/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["npm-publish", "git-push", "github-release"]
"postTargets": ["npm-publish", "github-release"]
}
},
"npm-publish": {
Expand All @@ -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": {
Expand Down

0 comments on commit c5caee7

Please sign in to comment.