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

Publish NPM packages from CI #8828

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Publish NPM packages from CI #8828

merged 4 commits into from
Apr 24, 2024

Conversation

Pessimistress
Copy link
Collaborator

Background

After this PR, the publish workflow will be

  • Switch to the appropriate branch (master for alpha/beta in development or *-release for production)
  • Edit CHANGELOG.md
  • Run yarn publish-beta or yarn publish-prod (note: with dash)

The publish command will only bump versions in package.json files, tag the commit and push to remote. The CI will then test, build, and publish to NPM.

As discussed offline, this will remove the differences in local dev environments and ensure predictable results. Also saves us time from working around render test inconsistencies and random errors.

I have tested the version bumping and tagging part of the workflow. Can't verify the CI workflow until merged. May need to follow up with more PRs to fix any CI issues.

Change List

  • Bump ocular-dev-tools
  • Enforce changelog update before publishing
  • Release CI flow

Change List (outside this PR)

  • Add npm access token as secret
  • Restrict push permission of *-release branches to admins only

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

rubber stamp

@Pessimistress Pessimistress merged commit 8acba03 into master Apr 24, 2024
4 checks passed
@Pessimistress Pessimistress deleted the x/publish-from-ci branch April 24, 2024 21:06
@donmccurdy
Copy link
Collaborator

Restrict push permission of *-release branches to admins only

Does this affect the publish workflow you described above? If a non-admin is trying to publish a new release on a visgl repository, do we also support a workflow allowing non-admins to cut the release? Example:

  1. Create a new branch off the target *-release branch
  2. Cherry-pick commits for the new version
  3. Run yarn publish-[mode]
  4. New branch is pushed to remote
  5. Open a PR
  6. Wait for review, merge the PR
  7. CI publishes the release to npm

The only minor issue I see in that workflow is that Git tags are pushed before the PR is approved and merged, but that isn't necessarily a problem.

@Pessimistress
Copy link
Collaborator Author

My plan is to just manage publish rights by managing push permission to the release branches. If someone is allowed to publish then they will be allowed to push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants