Skip to content

Versioning and Releases

Ashley Kolodziej edited this page Oct 28, 2021 · 3 revisions

You can force your CSS and Javascript to refresh in your theme by updating your theme version. When you update your theme version, the framework uses a process called cache busting to make sure browsers know there is a new version of the CSS and JavaScript available.

How to update the version in your theme

  1. Choose the correct branch. If you are creating a release, please use Git-Flow now to start your release branch. See "Do I need to create a release?" for details.
  2. Change the version number in package.json. Use the current version number as a starting point. Here are some examples of how you would change the version in a theme if the current version was 1.0.9.
    • If the change is a bug fix: Add one to the last number. In the above example, the new version would be 1.0.10.
    • If the change is a new feature which does not affect existing features: Add one to the middle number and set the last number to 0. In the above example, the new version would be 1.1.0.
    • If the change introduces an entirely new design or changes things in a way that is not backwards compatible: Add one to the first number and set both the middle and last numbers to 0. In the above example, the new version would be 2.0.0.
  3. Run grunt version.
  4. Add a section in CHANGELOG.md with a brief bullet list of changes introduced by this release. Use your new version number as the heading.
  5. Run grunt build. The following files should show changes in Tower (or your git tool of choice):
    • CHANGELOG.md
    • css-dev/style.scss
    • functions.php
    • ie.css
    • ie.min.css
    • package.json
    • style.css
    • style.min.css
    • Note: Some very old themes will not have style.min.css or ie.min.css.
  6. Stage all changes and commit using "Version bump to x.x.x" as the commit message. Replace x.x.x with the version number above.
  7. If you are creating a release, use Git-Flow to finish the release, and push changes to both master/main and develop. Be sure to select "Push all tags" in Tower when doing this.

Do I need to create a release?

Releases are currently being piloted for deploys to live websites. If you are working on a theme that is currently live on a website and releases are set up, check in with a developer for assistance. We recommend using Git-Flow in your Git tool of choice (such as Tower) to make the release process easier.