-
Notifications
You must be signed in to change notification settings - Fork 182
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
Publish with Travis CI #33
Conversation
We'll probably need to re-encrypt the AWS credentials in |
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.
awesome, thanks for grabbing this! Had a couple of questions, most notably around split version support (which I'd really love to do), but nothing blocking.
@@ -2,8 +2,23 @@ language: node_js | |||
node_js: | |||
- "8.10" | |||
- "10" | |||
before_install: | |||
- npm install -g yarn |
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.
as far as I can tell, the presence of yarn.lock
means that yarn will already be available (docs)
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.
The one that Travis preinstalls is old and doesn't support yarn workspace
command. npm install -g yarn
is to upgrade the yarn version.
"lerna run --stream --scope zapier-platform-cli --scope zapier-platform-core --scope zapier-platform-schema --scope zapier-platform-legacy-scripting-runner smoke-test" | ||
"lerna run --stream --scope zapier-platform-cli --scope zapier-platform-core --scope zapier-platform-schema --scope zapier-platform-legacy-scripting-runner smoke-test", | ||
"bump": | ||
"lerna version --exact --force-publish=zapier-platform-cli,zapier-platform-core,zapier-platform-schema", |
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.
Since i'm scared to actually run and test this command, can you talk a little about what actually happens when this is run?
My main concern is if we'll be able to easily version packages (mostly) individually. I think these will be our most common release patterns:
core
alone:9.0.1
->9.0.2
with no change in the schema dep- maj/min/patch release of
schema
, which causes the same incore
(while depending on the new version). Eg,schema
goes9.0.1
->9.0.2
,core
goes from9.0.2
->9.0.3
w/ a bugfix and updated schema dependency - major version of cli (
8
->9
), no change in cli / core
Are are all of those supported and straightfoward with this command?
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.
lerna version
is like going through each individual package and run yarn version
command. For each package, it'll prompt us for the version to bump. Here's an example I've been using to test:
By default lerna version
, only bumps the packages that have changed since the last tagged released. --force-publish
is there to make sure to bump all three packages (cli
, schema
, core
) every time we bump.
Separate versioning is also something I love to see happening, but I narrowed down the scope of this PR, so it only deals with the current situation, which is to version altogether. On the operating level, I think it should be easy to do separate versioning. We probably only need to remove that --force-publish
part from the yarn bump
command. The hard part is the application-level dependencies, how we find and remove them in each package.
cd .. | ||
|
||
# Revert version | ||
bin/update-boilerplate-dependencies.js revert | ||
# Don't let yarn pile up useless caches of local packages. |
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.
great attention to detail in these yarn usecases
# cd to the package and publish it! | ||
PKG_PATH=`yarn workspaces info -s | jq -r ".$PKG_NAME.location"` | ||
cd $PKG_PATH | ||
npm publish --registry $NPM_REGISTRY |
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.
is there a reason we need to specify the registry here?
Also (though I imagine yarn publish
uses npm publish
under the hood), why not use yarn
?
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.
Great questions!
It's there because I tested the script with a self-hosted registry (Verdaccio to be specific). Probably a good idea to leave it there to make future testing easy.
I tried to use yarn publish
but couldn't get it to work. There isn't an easy way to test yarn publish
with a self-hosted registry. More importantly, unlike we can use an auth token with npm publish
, yarn publish
always asks for a password when publishing, which makes it impossible to work on CI.
@xavdid As a side note, I know we talked about dropping Lerna in favor of |
Allows to publish npm packages from Travis CI. The process is going to be like:
yarn bump
locally and select the versions to bumpPACKAGE_NAME@VERSION
for each package (e.g.zapier-platform-cli@8.2.1
andzapier-platform-core@8.2.1
) is pushed to GitHubscripts/publish.sh
, which publishes a package to npm registryzapier-platform-core
, apostpublish
hook is configured to build and upload the boilerplate to S3