Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
feat(tag-builds): excluded pre-release tags from building
Browse files Browse the repository at this point in the history
since, like other tags for version publishes, it verifies the same things that were already verified
in the build that published

for #8
  • Loading branch information
travi committed Jan 22, 2019
1 parent 770a0ae commit d561ecb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/scaffolder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import writeYaml from '../third-party-wrappers/write-yaml';

const publishedVersionRegex = '/^v\\d+\\.\\d+\\.\\d+(-(alpha|beta)\\.\\d+(@(alpha|beta))?)?$/';

function nodeVersionIs8Above12(nodeVersion) {
return 8.12 <= nodeVersion && 9 > nodeVersion;
}
Expand All @@ -24,7 +26,7 @@ export default async function ({projectRoot, vcs, visibility, packageType, nodeV
await writeYaml(`${projectRoot}/.travis.yml`, {
language: 'node_js',
notifications: {email: false},
...'Package' === packageType && {branches: {except: ['/^v\\d+\\.\\d+\\.\\d+$/']}},
...'Package' === packageType && {branches: {except: [publishedVersionRegex]}},
...privateNpmTokenIsNeeded(visibility) && {
/* eslint-disable-next-line no-template-curly-in-string */
before_install: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc'
Expand Down
3 changes: 2 additions & 1 deletion test/unit/scaffolder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ suite('travis', () => {
});

suite('package', () => {
const regexToExcludePublishedVersionTagsFromBuilding = '/^v\\d+\\.\\d+\\.\\d+$/';
const regexToExcludePublishedVersionTagsFromBuilding
= '/^v\\d+\\.\\d+\\.\\d+(-(alpha|beta)\\.\\d+(@(alpha|beta))?)?$/';
const configToPublishWithSemanticRelease = {
provider: 'script',
skip_cleanup: true,
Expand Down

0 comments on commit d561ecb

Please sign in to comment.