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

Create version bumping task #16

Closed
mikeybanez opened this issue Oct 13, 2015 · 3 comments
Closed

Create version bumping task #16

mikeybanez opened this issue Oct 13, 2015 · 3 comments
Assignees
Milestone

Comments

@mikeybanez
Copy link
Collaborator

For a quicker release process. This should update both npm and bower version numbers.

If possible, we should also automatically add the version number as a comment in the build.

@ghost ghost self-assigned this Oct 23, 2015
@ghost
Copy link

ghost commented Oct 26, 2015

@Matrim-Cauthon, should we go ahead and use npm version minor by using npm.commands? I found this on NPM website:

Although npm can be used programmatically, its API is meant for use by the CLI only, and no guarantees are made regarding its fitness for any other purpose. If you want to use npm to reliably perform some task, the safest thing to do is to invoke the desired npm command with appropriate arguments.

We could however go ahead and use it programmatically, but there are alternatives to this.

  • One is by updating the package.json and bower.json files
  • Or, by executing a CLI command through nodejs using require('child_process').exec

I tried both approach, and it would work as expected. One thing to note though is that when using npm version, it would auto-tag it and auto-commit it (thus requiring the current branch to be clean) unless we add a --no-git-tag-version flag and --force flag to prevent it from auto-committing and auto-tagging.

Another possible approach is by using the ordinary npm version on the CLI itself, but adding a 'scripts' attribute on the package.json:

"scripts": {
  "preversion": "gulp test",
  "version": "gulp version && git add",
  "postversion": "git push && git push --tags"
}

The gulp version should build the file and add the necessary comments on the compiled xjs.js. Also, it could version up the bower file programmatically.

@mikeybanez
Copy link
Collaborator Author

should we go ahead and use npm version minor

Note that we don't just need to bump the minor version. This will be true especially when we do true semver, which will happen when we get to a stable version --- 1.X.X or higher.

I'm biased towards a gulp-based approach since we're using that to define our most-commonly used tasks anyway. How it's implemented under the hood is not important as long as we're able to specify how to bump the version number 👍

@ghost
Copy link

ghost commented Oct 26, 2015

The npm version minor was just an example. So we'll just go ahead and do this:

One is by updating the package.json and bower.json files

This way, we will be the ones to manually commit the changes, and manually add the tag. I believe this is OK since we usually bump the versions on the develop or release branch, while we tag the versions on our master branch.

The command would be like this:

gulp version --major|minor|patch --up|down

Without the flags, it would behave as gulp version --minor --up

What this gulp task would do is execute the default task first, then execute the version up/down task.

@ghost ghost assigned mikeybanez and unassigned ghost Oct 26, 2015
@ghost ghost added the review label Oct 26, 2015
@mikeybanez mikeybanez assigned SML-MeSo and unassigned mikeybanez Oct 28, 2015
@mikeybanez mikeybanez added this to the 0.9.0 milestone Oct 28, 2015
@ghost ghost closed this as completed in a1533ea Nov 5, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants