This guide outlines the steps to create and publish a new release.
Replace <VERSION> with the actual version number (e.g., 1.0.1).
- All feature development for this release is complete and merged into your release branch (e.g.,
mainor a dedicated release preparation branch). - Your local repository is clean (
git statusshows no uncommitted changes beyond what's intended for the release). - You are on the branch you intend to release from (e.g.,
git checkout main). - Pull the latest changes for this branch:
git pull origin <branch-name>(e.g.,git pull origin main).
This step uses the dev-bump-build-test.sh script. It will:
1. Update package.json to <VERSION>.
2. Update package-lock.json. (npm install --package-lock-only)
3. Run tools/updateVersion.js to generate src/version.js.
4. Run npm run build:esm-only (as per the script).
5. Run npm test -- tests/SquibView.test.js (as per the script).
sh dev-bump-build-test.sh <VERSION>- Example:
sh dev-bump-build-test.sh 1.0.1
The dev-bump-build-test.sh script runs build:esm-only. If your full production build is different (e.g., npm run build which might build multiple formats):
npm run buildEnsure all tests pass before proceeding.
npm run test:allIMPORTANT: Update the CDN examples to use the new version number.
Update these files:
examples/example_esm_cdn.htmlexamples/example_umd_cdn.html
Replace the version in the CDN URLs:
// ESM CDN example
import SquibView from 'https://cdn.jsdelivr.net/npm/squibview@<VERSION>/dist/squibview.esm.min.js';
// UMD CDN example
<script src="https://unpkg.com/squibview@<VERSION>/dist/squibview.umd.min.js"></script>Commit the version changes made to package.json, package-lock.json, src/version.js, and CDN examples.
git add package.json package-lock.json src/version.js examples/example_*_cdn.html
git commit -m "Release v<VERSION>"- Example:
git commit -m "Release v1.0.1"
Push the release commit to the remote repository (if you haven't already as part of feature merging).
git push origin <branch-name>- Example:
git push origin main
Tag the release commit. Ensure you are on the correct commit before tagging.
git tag -a v<VERSION> -m "Version <VERSION>"- Example:
git tag -a v1.0.1 -m "Version 1.0.1"
git push origin v<VERSION>- Example:
git push origin v1.0.1
Use the GitHub CLI to create the release on GitHub. This will use the tag you just pushed.
gh release create v<VERSION> --title "Version <VERSION>" --generate-notes --latest- Alternatively, to write custom notes directly:
gh release create v<VERSION> --title "Version <VERSION>" --notes "Your detailed release notes here." --latest - You can also create/edit the release via the GitHub web UI if preferred.
Always do a dry run first! This shows you what files will be published without actually publishing.
npm publish --dry-runReview the output carefully. Check the file list and package version.
If the dry run is satisfactory:
npm publish- If you used a separate release branch, merge it back into
main(if not already done) and then into any active long-term development branches. git checkout main && git pull && git checkout <develop-branch> && git pull && git merge main- Announce the new release to your users/community.