Skip to content

feat: publish beta and development tags on npm #4769

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

Merged
merged 6 commits into from
Jan 21, 2022
Merged

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Jan 19, 2022

Changes

This PR makes two major changes to how we release the npm package.

PRs are published with PR number and commit

When a PR is opened into main, we publish the npm package under a tag with the PR number. For example, you could install code-server based on #4768 and the commit 1a44d9b by running:

yarn global add code-server@4768

If you needed to install a previous commit on the same PR, you can get more specific and run this:

yarn global add code-server@4768-1a44d9b8839642b048fe5816946208a9e910f132

This allows developers to test PR changes in a production setting by installing code-server locally with a specific tag.

Merges into main are published on npm under the beta tag

Anytime a PR is merged into the main branch, it triggers a GitHub Actions workflow to publish those changes as an npm package tagged with beta.

This allows anyone using code-server to use the bleeding edge version by running yarn global add code-server@beta. The benefit of this is allowing both users and maintainers to test new features before a release.

Screenshots

image

Testing

You can test the development version from this PR here. To install locally run:

yarn add code-server@4769

Questions

Is there a limit to how often we can publish to npm?

According to S/O, no:

there is no restriction on how often a package can be published.

Fixes #4744

@jsjoeio jsjoeio self-assigned this Jan 19, 2022
@jsjoeio jsjoeio temporarily deployed to CI January 19, 2022 22:51 Inactive
@jsjoeio jsjoeio changed the title placeholder commit message feat: publish beta and development tags on npm Jan 19, 2022
@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #4769 (e7d006c) into main (63f99da) will not change coverage.
The diff coverage is n/a.

❗ Current head e7d006c differs from pull request most recent head 04a218f. Consider uploading reports for the commit 04a218f to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4769   +/-   ##
=======================================
  Coverage   69.18%   69.18%           
=======================================
  Files          29       29           
  Lines        1652     1652           
  Branches      363      363           
=======================================
  Hits         1143     1143           
  Misses        432      432           
  Partials       77       77           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63f99da...04a218f. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jan 19, 2022

✨ Coder.com for PR #4769 deployed! It will be updated on every commit.

@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 19:53 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 20:17 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 21:10 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 21:24 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 22:03 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 22:18 Inactive
@jsjoeio jsjoeio marked this pull request as ready for review January 20, 2022 22:40
@jsjoeio jsjoeio requested a review from a team January 20, 2022 22:40
Copy link
Contributor Author

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

This works! See published version here: https://www.npmjs.com/package/code-server/v/4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040

I would like a second opinion on the implementation. There are ways we can refactor this but I am unsure if it's necessary.

@jsjoeio jsjoeio temporarily deployed to CI January 20, 2022 23:01 Inactive
This adds new log to publish the npm package both while working on PRs and when
PRs are merged into main, allowing us to easily test changes in a
production-like setting.
@jsjoeio jsjoeio temporarily deployed to CI January 21, 2022 22:15 Inactive
@jsjoeio jsjoeio requested a review from code-asher January 21, 2022 22:15
@jsjoeio jsjoeio temporarily deployed to CI January 21, 2022 22:33 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 21, 2022 22:43 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 21, 2022 22:52 Inactive
@jsjoeio jsjoeio temporarily deployed to CI January 21, 2022 23:00 Inactive
@jsjoeio jsjoeio merged commit a2f5301 into main Jan 21, 2022
@jsjoeio jsjoeio deleted the jsjoeio-beta-yarn branch January 21, 2022 23:28
TinLe pushed a commit to TinLe/code-server that referenced this pull request Apr 23, 2022
* feat: add logic to publish beta/dev npm

This adds new log to publish the npm package both while working on PRs and when
PRs are merged into main, allowing us to easily test changes in a
production-like setting.

Co-authored-by: Asher <[email protected]>
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.

Publish beta release on npm
2 participants