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

ci: Fix prerelease canary builds #501

Merged
merged 3 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stages:
if: type = pull_request

- name: trunk
if: branch = master OR branch =~ /^prerelease\// AND type != pull_request
if: (branch = master OR branch =~ /^prerelease\//) AND type != pull_request

- name: tag
if: branch =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/ AND tag IS present
Expand Down
17 changes: 13 additions & 4 deletions utils/publish-canary.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const {
TRAVIS_BUILD_URL = 'https://travis-ci.org/Workday/canvas-kit/branches',
} = process.env;

const regex = /@workday\/[a-z-]*@(\d*.\d*.\d*-next.\d*\+\w*)/gm;
const data = {};
let preid;

Expand All @@ -24,7 +23,17 @@ if (TRAVIS_BRANCH === 'master') {
process.exit(1);
}

cmd(`yarn lerna publish --yes --force-publish="*" --canary --preid ${preid} --dist-tag ${preid}`)
const regex = new RegExp('@workday\\/[a-z-]*@(\\d*.\\d*.\\d*-' + preid + '.\\d*\\+\\w*)', 'g');
const lernaFlags = [
`--yes`,
`--force-publish="*"`,
`--canary`,
`--preid ${preid}`,
`--dist-tag ${preid}`,
preid === 'prerelease' ? 'major' : '',
];

cmd(`yarn lerna publish ${lernaFlags.join(' ')}`)
.then(output => {
console.log(output);

Expand All @@ -40,8 +49,8 @@ cmd(`yarn lerna publish --yes --force-publish="*" --canary --preid ${preid} --di
json: {
attachments: [
{
fallback: 'Plain-text summary of the attachment.',
color: '#2eb886',
fallback: `New canary build published (v${data.version})`,
color: 'good',
author_name: `New canary build published (v${data.version})`,
author_link: TRAVIS_BUILD_URL,
title: `Merge commit ${sha}`,
Expand Down