diff --git a/README.md b/README.md index ad0092fe8..211a23082 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,104 @@ See [the Releases section of our GitHub project](https://github.com/entreprise7p * Compile first * npm publish --access public +## Releasing a new version + +This is the maintainer release procedure. The commands below use `v3.4.9` as an +example; substitute the version being released. Releases are prepared on +`v3-dev` (the default branch). No merge to `main` is required. + +1. **Prepare the version and review the working tree.** + + ```sh + git switch v3-dev + git status --short + ``` + + Update the current version references in `package.json`, `package-lock.json`, + `package.js`, `_config.yml`, and JavaScript component sources (`js/*.js` + headers and `Constructor.VERSION` values). Verify they agree. If you use + `npm run change-version -- OLD NEW`, review the diff carefully: that script + performs broad text replacements and can change historical documentation. + +2. **Run tests and build the release artifacts.** + + ```sh + npm ci + npx grunt test-js + npm run release + git diff --check + git status --short + ``` + + `test-js` runs JavaScript lint, style checks, and the Karma browser tests. + On Linux with Snap Firefox, `Gruntfile.js` sets a Snap-accessible temporary + profile directory for local tests; CI retains its normal Karma command. + `npm run release` runs `grunt prep-release`, updates SRI values through + `npm run sri`, and produces `bootstrap--dist.zip` through + `npm run release-zip`. There is no need to run `release-zip` again. + The full build may require Ruby/Jekyll dependencies (`bundle install`). + + Review generated `dist/` files, documentation, and `_config.yml` changes. + Check that the ZIP contains the expected release files. + +3. **Commit and push all intended release changes.** + + ```sh + git add -u + # Explicitly add any intended new files with git add . + git diff --cached --check + git diff --cached --stat + git commit -m "Release v3.4.9" + git push origin v3-dev + ``` + + If the changes are already committed, skip the commit. Do not add unrelated + local archives or other untracked files. Verify the relevant + [GitHub Actions checks](https://github.com/entreprise7pro/bootstrap/actions) + are green for the release commit before tagging. + +4. **Tag the tested commit and push the annotated tag.** + + ```sh + git status --short + git tag -a v3.4.9 -m "Bootstrap v3.4.9" + git push origin v3.4.9 + ``` + + Make sure the working tree is clean and the tag points to the intended + commit. Do not overwrite an existing published tag to correct a release. + Review any GitHub Actions checks triggered by the tag. + +5. **Create the GitHub Release.** Open + [New release](https://github.com/entreprise7pro/bootstrap/releases/new), + choose the existing `v3.4.9` tag, write release notes, and optionally attach + `bootstrap-3.4.9-dist.zip`. Publish the release as the latest stable release. + Pushing a tag does **not** automatically create a GitHub Release unless a + workflow explicitly handles that step. + +6. **Publish npm if automation has not already done so.** The npm package name + is `entreprise7pro-bootstrap` (not `entreprise7pro/bootstrap`). + + ```sh + npm whoami + npm view entreprise7pro-bootstrap@3.4.9 version + npm pack --dry-run + npm publish --access public + npm view entreprise7pro-bootstrap@3.4.9 version + ``` + + The first `npm view` may return a not-found error if the version has not yet + been published; that is expected. If it *does* exist, **do not publish it + again**. Use the correct npm account and any required authentication. Review + the package contents before publishing. + +7. **Verify Packagist and documentation.** Check that + [`entreprise7pro/bootstrap`](https://packagist.org/packages/entreprise7pro/bootstrap) + lists the new Git tag. If automatic updates have not picked it up, sign in + to Packagist and use **Update**. Verify the new version is available to + Composer consumers, and refresh [bootstrap.7pro.ca](https://bootstrap.7pro.ca/) + if the documentation deployment is not automatic. + ## Thanks BrowserStack Logo