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
Trigger canary release on successful PR build #246
Changes from all commits
bf8942a
2e44d06
a572720
9ce110d
50e6f4c
fa38af4
a20f259
29e2566
bdc537f
a41446a
8f443ab
c1b119a
570b667
5bb4059
7613846
95aac5b
b8d7aeb
b482fd8
610e213
79cf276
af83807
2b16f69
e5a115e
2f20282
14c5ecb
908ab0e
f71f97d
172f6c2
88a0b4e
a4d6392
999c6d4
65925c3
89ba9a0
4abd9bd
cf82ee4
4bb84f8
03d2e1f
e18e8f7
0a07d2f
e99ae79
c3abddc
f40a30c
0d3f6b7
9cce630
d96aa3b
92656aa
53ec496
c1ad972
9991349
d7ddfef
b57d529
871d806
7659b63
ae023e0
a9559e8
0ce097e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
language: node_js | ||
node_js: | ||
- '7' | ||
env: | ||
- TEST_DIR=modules/primer-css | ||
- TEST_DIR=modules/primer-core | ||
- TEST_DIR=modules/primer-product | ||
- TEST_DIR=modules/primer-marketing | ||
- TEST_DIR=modules/primer-alerts | ||
- TEST_DIR=modules/primer-base | ||
- TEST_DIR=modules/primer-blankslate | ||
- TEST_DIR=modules/primer-box | ||
- TEST_DIR=modules/primer-breadcrumb | ||
- TEST_DIR=modules/primer-buttons | ||
- TEST_DIR=modules/primer-cards | ||
- TEST_DIR=modules/primer-forms | ||
- TEST_DIR=modules/primer-labels | ||
- TEST_DIR=modules/primer-layout | ||
- TEST_DIR=modules/primer-markdown | ||
- TEST_DIR=modules/primer-marketing | ||
- TEST_DIR=modules/primer-marketing-type | ||
- TEST_DIR=modules/primer-marketing-utilities | ||
- TEST_DIR=modules/primer-navigation | ||
- TEST_DIR=modules/primer-page-headers | ||
- TEST_DIR=modules/primer-page-sections | ||
- TEST_DIR=modules/primer-support | ||
- TEST_DIR=modules/primer-table-object | ||
- TEST_DIR=modules/primer-tables | ||
- TEST_DIR=modules/primer-tooltips | ||
- TEST_DIR=modules/primer-truncate | ||
- TEST_DIR=modules/primer-utilities | ||
script: cd $TEST_DIR && npm install && npm test | ||
- 7 | ||
|
||
before_script: | ||
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}" | ||
- lerna bootstrap | ||
|
||
script: | ||
- npm test | ||
|
||
after_success: | ||
- script/cibuild --yes |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ | |
"scripts": { | ||
"bootstrap": "lerna bootstrap", | ||
"clean": "lerna clean", | ||
"updated": "lerna updated", | ||
"diff": "lerna diff", | ||
"publish": "lerna publish", | ||
"dev": "lerna publish --npm-tag=dev --skip-git", | ||
"rc": "lerna publish --npm-tag=rc --skip-git", | ||
"force": "lerna publish --force-publish=*" | ||
"updated": "lerna updated", | ||
"release": "lerna publish", | ||
"release-candidate": "lerna publish --npm-tag=rc", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI keeping the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, my thinking was that we don't need |
||
"release-canary": "lerna publish --npm-tag=canary --canary", | ||
"test": "lerna run test" | ||
}, | ||
"devDependencies": { | ||
"lerna": "^2.0.0-rc.5" | ||
"lerna": "^2.0.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# --yes gets passed in by .travis.yml, | ||
# which makes this easier to test locally | ||
args=${@:1} | ||
|
||
# always publish a canary release if this is a PR build | ||
if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then | ||
echo "🐦 Publishing canary version..." | ||
npm run release-canary -- ${args} | ||
# merges to dev build a release candidate | ||
elif [[ $TRAVIS_BRANCH = dev ]]; then | ||
echo "👌 Publishing release candidate..." | ||
echo npm run release-candidate -- ${args} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note the |
||
# publish a release when we merge to master | ||
elif [[ $TRAVIS_BRANCH = master ]]; then | ||
echo "📦 Publishing latest release!" | ||
echo npm run release -- ${args} | ||
else | ||
echo "⚠️ This isn't a PR and '${TRAVIS_BRANCH}' isn't a release branch." | ||
exit 1 | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# reads the tag either from $NPM_TAG or first positional arg: | ||
# script/compare-published [tag] | ||
tag=${1:-${NPM_TAG:-latest}} | ||
|
||
# this is way faster than `lerna exec npm info . .name` | ||
# (but will skip modules that don't have "primer-" in them) | ||
modules=`ls -1 modules | egrep primer-` | ||
|
||
# tabular output separator for column(1) | ||
s=, | ||
|
||
echo "📦 Comparing Primer modules published @${tag}..." | ||
( | ||
echo "module${s}tag${s}published${s}local" | ||
for module in $modules; do | ||
v_published=`npm info ${module}@${tag} .version` | ||
v_local=`jq -Mr .version modules/${module}/package.json` | ||
echo "${module}${s}${tag}${s}${v_published:-x}${s}${v_local}" | ||
done | ||
) | column -t -s=${s} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a release will be
lerna publish --yes
How does that resolve versions?
e.g.
If you merged changes to master that constitute a minor bump of:
a@1.1.0
toa@1.2.0
b@2.0.0
to becomeb@2.0.1
c@3.0.0
to becomec@3.0.1
and a major of:
d@4.0.0
tod@5.0.0
as well as a small change of:
c@3.0.0
toc@3.0.1
How would that all get resolved non interactively?
The result needs to be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for weighing in, @bradbarrow. My hope – perhaps based on bad assumptions, which I'm more than happy to reassess – was that we could do the version resolution with
lerna publish --no-npm
and file a PR with the resulting versions, then have those versions published without any incrementing or prompting when the PR merges. I haven't tested this out yet, but I plan to today.