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

chore: streamline package publishing #453

Merged
merged 19 commits into from
Dec 9, 2024
Merged

chore: streamline package publishing #453

merged 19 commits into from
Dec 9, 2024

Conversation

wjhsf
Copy link
Contributor

@wjhsf wjhsf commented Sep 9, 2024

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.

package.json Outdated Show resolved Hide resolved
wjhsf and others added 6 commits October 4, 2024 11:43
Splits the npm scripts into primary development tasks and lifecycle scripts:
- `build`
- `precommit`: Rebuilds all generated files
- `prepack`: Lifecycle script to guarantee compiled files are up-to-date before publishing
- `test`
- `version`: Lifecycle script to guarantee all files affected by a version bump are regenerated and added to git

All other scripts are prefixed with `_` to distinguish between the high-level development tasks above and smaller tasks that can be used as building blocks.

Also included in this PR:
- extracted the inline script that would check if any generated files had not been committed to `validate-generated-files.sh`
Splits the npm scripts into primary development tasks and lifecycle scripts:
- `build`
- `precommit`: Rebuilds all generated files
- `prepack`: Lifecycle script to guarantee compiled files are up-to-date before publishing
- `test`
- `version`: Lifecycle script to guarantee all files affected by a version bump are regenerated and added to git

All other scripts are prefixed with `_` to distinguish between the high-level development tasks above and smaller tasks that can be used as building blocks.

Also included in this PR:
- extracted the inline script that would check if any generated files had not been committed to `validate-generated-files.sh`
Splits the npm scripts into primary development tasks and lifecycle scripts:
- `build`
- `precommit`: Rebuilds all generated files
- `prepack`: Lifecycle script to guarantee compiled files are up-to-date before publishing
- `test`
- `version`: Lifecycle script to guarantee all files affected by a version bump are regenerated and added to git

All other scripts are prefixed with `_` to distinguish between the high-level development tasks above and smaller tasks that can be used as building blocks.

Also included in this PR:
- extracted the inline script that would check if any generated files had not been committed to `validate-generated-files.sh`
Suggested changes for CI and release automation
@wjhsf wjhsf enabled auto-merge (squash) December 9, 2024 17:02
@wjhsf wjhsf merged commit 626f627 into master Dec 9, 2024
10 checks passed
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.

2 participants