Skip to content
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
32 changes: 21 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,22 @@ jobs:
type: string
release_channel:
type: string
dist_tag:
type: string
docker: *docker
environment: *environment
steps:
- checkout
- run: yarn workspaces info | head -n -1 > workspace_info.txt
- *restore_node_modules
# TODO: This doesn't actually publish anything yet. Just logs the inputs.
- run: |
echo "<< parameters.commit_sha >>"
echo "<< parameters.release_channel >>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, what about the other publish_preleases with a #TODO at the bottom?

- run:
name: Run publish script
command: |
git fetch origin master
cd ./scripts/release && yarn && cd ../../
scripts/release/prepare-release-from-ci.js --skipTests -r << parameters.release_channel >> --commit=<< parameters.commit_sha >>
cp ./scripts/release/ci-npmrc ~/.npmrc
scripts/release/publish.js --ci --tags << parameters.dist_tag >>

workflows:
version: 2
Expand Down Expand Up @@ -516,12 +522,16 @@ workflows:
jobs:
- setup
- publish_prerelease:
name: Publish to Next channel
requires:
- setup
matrix:
parameters:
commit_sha:
- << pipeline.parameters.prerelease_commit_sha >>
release_channel:
- stable
- experimental
commit_sha: << pipeline.parameters.prerelease_commit_sha >>
release_channel: stable
dist_tag: next
- publish_prerelease:
name: Publish to Experimental channel
requires:
- setup
commit_sha: << pipeline.parameters.prerelease_commit_sha >>
release_channel: experimental
dist_tag: experimental
1 change: 1 addition & 0 deletions scripts/release/ci-npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
18 changes: 16 additions & 2 deletions scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,23 @@ const run = async () => {
const packageNames = params.packages;

if (params.ci) {
let failed = false;
for (let i = 0; i < packageNames.length; i++) {
const packageName = packageNames[i];
await publishToNPM(params, packageName, null);
try {
const packageName = packageNames[i];
await publishToNPM(params, packageName, null);
} catch (error) {
failed = true;
console.error(error.message);
console.log();
console.log(
theme.error`Publish failed. Will attempt to publish remaining packages.`
);
}
}
if (failed) {
console.log(theme.error`One or more packages failed to publish.`);
process.exit(1);
}
} else {
clear();
Expand Down