Skip to content

Conversation

@acdlite
Copy link
Collaborator

@acdlite acdlite commented Feb 4, 2021

PR #20728 added a command to initiate a prerelease using CI, but it left the publish job unimplemented. This fills in the publish job.

Uses an npm automation token for authorization, which bypasses the need for a one-time password. The token is configured via CircleCI's environment variable panel.

Currently, it will always publish the head of the main branch. If the head has already been published, it will exit gracefully.

It does not yet support publishing arbitrary commits, though we could easily add that. I don't know how important that use case is, because for PR branches, you can use CodeSandbox CI instead. Or as a last resort, run the publish script locally.

Always publishing from main is nice because it further incentivizes us to keep main in a releasable state. It also takes the guesswork out of publishing a prerelease that's in a broken state: as long as we don't merge broken PRs, we're fine.

Test plan

❯ yarn publish-prereleases
Using globally installed version of Yarn
yarn run v1.12.1
$ node ./scripts/release/publish-using-ci-workflow.js
✓ Creating CI workflow 253 ms
✓ Publishing in CI workflow: https://app.circleci.com/pipelines/workflows/894684e1-f09f-4c40-9310-65603cf3eb9e 2.5
mins
✨  Done in 154.82s.

Corresponding CI workflow that successfully published: https://app.circleci.com/pipelines/github/facebook/react/9764/workflows/894684e1-f09f-4c40-9310-65603cf3eb9e

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 4, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 4, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ab3712d:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Feb 4, 2021

Size changes

Comparing: 4c01958...97daa52

Stable channel

No significant bundle size changes to report.

Experimental channel

No significant bundle size changes to report.

Generated by 🚫 dangerJS against 97daa52

@acdlite acdlite force-pushed the ci-publish branch 2 times, most recently from 8451901 to ab3712d Compare February 4, 2021 02:26
PR facebook#20728 added a command to initiate a prerelease using CI, but it left
the publish job unimplemented. This fills in the publish job.

Uses an npm automation token for authorization, which bypasses the need
for a one-time password. The token is configured via CircleCI's
environment variable panel.

Currently, it will always publish the head of the main branch. If the
head has already been published, it will exit gracefully.

It does not yet support publishing arbitrary commits, though we could
easily add that. I don't know how important that use case is, because
for PR branches, you can use CodeSandbox CI instead. Or as a last
resort, run the publish script locally.

Always publishing from main is nice because it further incentivizes us
to keep main in a releasable state. It also takes the guesswork out of
publishing a prerelease that's in a broken state: as long as we don't
merge broken PRs, we're fine.
@acdlite acdlite force-pushed the ci-publish branch 2 times, most recently from 8df35fb to 97daa52 Compare February 4, 2021 03:18
@acdlite acdlite marked this pull request as ready for review February 4, 2021 03:26
@acdlite acdlite merged commit c64d6d2 into facebook:master Feb 4, 2021
# 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?

koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
PR facebook#20728 added a command to initiate a prerelease using CI, but it left
the publish job unimplemented. This fills in the publish job.

Uses an npm automation token for authorization, which bypasses the need
for a one-time password. The token is configured via CircleCI's
environment variable panel.

Currently, it will always publish the head of the main branch. If the
head has already been published, it will exit gracefully.

It does not yet support publishing arbitrary commits, though we could
easily add that. I don't know how important that use case is, because
for PR branches, you can use CodeSandbox CI instead. Or as a last
resort, run the publish script locally.

Always publishing from main is nice because it further incentivizes us
to keep main in a releasable state. It also takes the guesswork out of
publishing a prerelease that's in a broken state: as long as we don't
merge broken PRs, we're fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants