Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
feat(travis-after-success): Update semantic release (#6)
Browse files Browse the repository at this point in the history
* feat(travis-after-success): Update semantic-release to latest version

Update semantic-release and also add dry run on non master CI-builds

* test(travis-after-success): Update test snapshots

* fix(travis-after-success): Update when to run semantic-release dry run
  • Loading branch information
adambrgmn authored Dec 14, 2017
1 parent 9a54987 commit 2331828
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/scripts/__tests__/__snapshots__/travis-after-success.js.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`travis-after-success calls concurrently with both scripts when on travis 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release pre && npm publish && semantic-release post'"`;
exports[`travis-after-success calls concurrently with both scripts when on travis 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not do autorelease script when running on travis but in a pull request 1`] = `concurrently --prefix [{name}] --names codecov --prefix-colors bgBlue.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'"`;
exports[`travis-after-success does not do autorelease script when running on travis but in a pull request 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'"`;

exports[`travis-after-success does not do the autorelease script when the version is different 1`] = `concurrently --prefix [{name}] --names codecov --prefix-colors bgBlue.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'"`;
exports[`travis-after-success does not do the autorelease script when the version is different 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'"`;

exports[`travis-after-success does not do the codecov script when opted out 1`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release pre && npm publish && semantic-release post'"`;
exports[`travis-after-success does not do the codecov script when opted out 1`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not do the codecov script when there is no coverage directory 1`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release pre && npm publish && semantic-release post'"`;
exports[`travis-after-success does not do the codecov script when there is no coverage directory 1`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not run either script when no coverage dir and not the right version 1`] = `
Array [
Array [
No need to autorelease or report coverage. Skipping travis-after-success script...,
No need to autorelease or report coverage.,
],
]
`;
8 changes: 3 additions & 5 deletions src/scripts/travis-after-success.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ const autorelease =
const reportCoverage = hasFile('coverage') && !parseEnv('SKIP_CODECOV', false);

if (!autorelease && !reportCoverage) {
console.log(
'No need to autorelease or report coverage. Skipping travis-after-success script...',
);
console.log('No need to autorelease or report coverage.');
} else {
const result = spawn.sync(
resolveBin('concurrently'),
Expand All @@ -28,8 +26,8 @@ if (!autorelease && !reportCoverage) {
? `echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'`
: null,
release: autorelease
? `echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release pre && npm publish && semantic-release post'`
: null,
? `echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'`
: `echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'`,
},
{ killOthers: false },
),
Expand Down

0 comments on commit 2331828

Please sign in to comment.