Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(setup): add github actions as CI option #502

Merged
merged 23 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
scheduleCircleCI -> schedulePrepare
  • Loading branch information
jeetiss committed Dec 14, 2019
commit 17acf7275989dadf8f0759ac9f51ab13ee0bb4d7
12 changes: 6 additions & 6 deletions packages/shipjs/src/step/setup/CI/addCircleCIConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import mkdirp from 'mkdirp';
import { print } from '../../../util';
import { info, warning } from '../../../color';

export default ({ baseBranch, scheduleCircleCI, cronExpr, dir, dryRun }) =>
export default ({ baseBranch, schedulePrepare, cronExpr, dir, dryRun }) =>
runStep(
{
title: 'Creating CircleCI configuration',
Expand All @@ -30,7 +30,7 @@ export default ({ baseBranch, scheduleCircleCI, cronExpr, dir, dryRun }) =>
}
const content = getConfig({
baseBranch,
scheduleCircleCI,
schedulePrepare,
cronExpr,
gitUserName: getGitConfig('user.name') || 'Your Name',
gitUserEmail: getGitConfig('user.email') || '[email protected]',
Expand All @@ -54,7 +54,7 @@ export default ({ baseBranch, scheduleCircleCI, cronExpr, dir, dryRun }) =>

function getConfig({
baseBranch,
scheduleCircleCI,
schedulePrepare,
cronExpr,
gitUserName,
gitUserEmail,
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- run:
name: Run Tests
command: yarn test
<% if (scheduleCircleCI) { %>
<% if (schedulePrepare) { %>
prepare_release:
<<: *defaults
steps:
Expand Down Expand Up @@ -141,7 +141,7 @@ workflows:
- release_if_needed:
requires:
- test
<% if (scheduleCircleCI) { %>
<% if (schedulePrepare) { %>
schedule_release:
triggers:
- schedule:
Expand All @@ -154,6 +154,6 @@ workflows:
- prepare_release
<% } %>
`,
{ baseBranch, scheduleCircleCI, cronExpr, gitUserName, gitUserEmail }
{ baseBranch, schedulePrepare, cronExpr, gitUserName, gitUserEmail }
);
}
8 changes: 4 additions & 4 deletions packages/shipjs/src/step/setup/CI/askCircleCI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import inquirer from 'inquirer';
import formatMessage from '../formatMessage';

export default async function askCircleCI() {
const { scheduleCircleCI } = await inquirer.prompt([
const { schedulePrepare } = await inquirer.prompt([
{
type: 'confirm',
name: 'scheduleCircleCI',
name: 'schedulePrepare',
message: 'Schedule your release via CircleCI?',
default: true,
},
Expand All @@ -16,7 +16,7 @@ export default async function askCircleCI() {
const defaultCronExpr = `0 ${hour} * * ${tuesday}`;
const { cronExpr } = await inquirer.prompt(
[
scheduleCircleCI
schedulePrepare
? {
type: 'input',
name: 'cronExpr',
Expand All @@ -31,7 +31,7 @@ export default async function askCircleCI() {
);

return {
scheduleCircleCI,
schedulePrepare,
cronExpr,
};
}