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

integrate xyz for effortless releases #27

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

davidchambers
Copy link
Collaborator

See #18

This pull request adds xyz as a dev dependency to support the following commands:

$ npm run release major
$ npm run release minor
$ npm run release patch

We can run one of the above with the --dry-mode option to see what it would do:

$ npm run release -- minor --branch xyz --dry-run

> hubot-gitter2@0.1.3 release /Users/dc/github.com/huafu/hubot-gitter2
> xyz --repo git@github.com:huafu/hubot-gitter2.git --branch master --tag X.Y.Z --increment "minor" "--branch" "xyz" "--dry-run"

Current version is 0.1.3. Press [enter] to publish hubot-gitter2@0.2.0.
npm prune
npm test
node -e 'var o = require("./package.json"); o.version = "0.2.0"; require("fs").writeFileSync("./package.json", JSON.stringify(o, null, 2) + "\n");'
git add 'package.json'
git commit --message 'Version 0.2.0'
git tag --annotate '0.2.0' --message 'Version 0.2.0'
git push --atomic 'git@github.com:huafu/hubot-gitter2.git' 'refs/heads/xyz' 'refs/tags/0.2.0'
npm publish

Note that in the command above I specified --branch xyz because xyz will abort if one is on a different branch. In the actual command we specify --branch master as I assume we only ever want to publish from master.

These commands will work provided the following assumptions hold:

  • xyz is run from the specified branch;
  • the person running the command can push to this repository via SSH;
  • the person running the command can push this package to the public npm registry.

If you have any questions, @huafu, don't hesitate to ask. I'd love to see a new release soon so I can stop referencing a GitHub commit in my package.json. :)

@davidchambers
Copy link
Collaborator Author

Have you any interest in merging this pull request, @huafu?

@davidchambers
Copy link
Collaborator Author

We should specify "files" in package.json rather than rely on .npmignore.

package.json Outdated
@@ -21,8 +22,18 @@
"url": "https://github.com/huafu/hubot-gitter2/issues"
},
"homepage": "https://github.com/huafu/hubot-gitter2",
"files": [
"/doc/",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included this when removing .npmignore to avoid changing the list of files included in the tarball. Actually, though, I suggest we exclude this HTML documentation from the tarball. Do you agree, @huafu?

Is the HTML documentation up to date? If so, how is it updated? If not, shall we remove it from the repository?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc is outdated I guess, anyway:

  • yes, remove doc from the release since it should be viewable online only
  • if I remember well there was a script generating the doc from the comments and then publishing it to the gh-pages branch, I'll try to take a look at that and give you more info...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed "/doc/" from "files". :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants