Skip to content

Commit

Permalink
feat: Automatically bump theme version in style.scss on npm version
Browse files Browse the repository at this point in the history
Closes #24
  • Loading branch information
delucis committed Dec 2, 2018
1 parent 323493d commit dd60743
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ To change `css` styling, edit `scss/style.scss`, which will auto-compile if `npm

1. Document changes in [`CHANGELOG.md`](CHANGELOG.md).

2. Increment version number in `scss/style.scss` header (and auto-compile a new `style.css`) using [semantic versioning](http://semver.org/).

3. Increment the package version number and tag the commit using `npm version`:
2. Increment the package version number and tag the commit using `npm version`:
```sh
npm version major # 1.3.2 -> 2.0.0
npm version minor # 1.3.2 -> 1.4.0
Expand All @@ -56,14 +54,14 @@ To change `css` styling, edit `scss/style.scss`, which will auto-compile if `npm
npm version patch -m "Release %s. Closes #39."
```

4. Push your changes including the newly created tag:
3. Push your changes including the newly created tag:
```sh
git push --follow-tags
```

After you have pushed your tag, Travis CI will build `hgnm-2014.zip` and attach it to the GitHub release. This archive is used by automatic theme updates in WordPress.

5. Copy the changes listed in `CHANGELOG.md` to the release notes on GitHub.
4. Copy the changes listed in `CHANGELOG.md` to the release notes on GitHub.

## Architecture

Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Repository for WordPress theme development for hgnm.org",
"scripts": {
"test": "sass-lint",
"version": "wp-update-project-version -p scss/style.scss && git add scss/style.scss",
"start": "npm run css:watch",
"build": "npm run test && npm run css:build && npm run copy && npm run zip && npm run clean",
"css:build": "node-sass --include-path scss --output-style compressed scss/style.scss style.css",
Expand All @@ -26,6 +27,7 @@
},
"homepage": "https://github.com/HGNM/hgnm-2014#readme",
"devDependencies": {
"@masonite/wp-project-version-sync": "^1.0.12",
"autoprefixer": "^9.3.1",
"bestzip": "^2.1.2",
"cpy-cli": "git+https://github.com/chimon2000/cpy-cli.git",
Expand Down

0 comments on commit dd60743

Please sign in to comment.