salesforce / tough-cookie

RFC6265 Cookies and CookieJar for Node.js
BSD 3-Clause "New" or "Revised" License
964 stars 207 forks source link

chore: streamline package publishing #453

Open wjhsf opened 1 month ago

wjhsf commented 1 month ago

Following today's v5 release, we saw a few points of improvement on our release process:

  1. The API docs include the current version number; docs are now updated as part of the version script.
  2. Two tests use a hard-coded version of the project. There's not much value added by doing that, and it's annoying to maintain, so I changed them to use the version file. a. The version file is also something we've considered removing, but in the meantime I've added a test to make sure that the file just exports a valid semver string.
  3. Added a GitHub Actions workflow to publish to npm, triggered by creating a GitHub release.

The new release process is:

  1. Check out code to release
  2. npm version <type>, using major/minor/etc. as appropriate
  3. git push && git push tags/<version>
  4. Create GitHub release
  5. πŸŽ‰ it's on npm!

Important: Publishing will require creating/storing an NPM_TOKEN secret. So gotta do that before this will actually work.

This PR also contains a few prettier fixes because that happens sometimes.