Skip to content

Commit

Permalink
Adding version scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-Laguna committed Sep 16, 2017
1 parent 3b7203c commit b1e0320
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ coverage
.Trashes
ehthumbs.db
Thumbs.db
webslides.zip
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ You can add:
- [Animate on scroll](http://michalsnik.github.io/aos/) (Useful for longform articles)
- [pt](http://williamngan.github.io/pt/)


### Dive In!

- Do not miss [our demos](https://webslides.tv/).
Expand Down
128 changes: 125 additions & 3 deletions package-lock.json

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

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"homepage": "https://github.com/webslides/webslides#readme",
"devDependencies": {
"archiver": "^2.0.3",
"autoprefixer": "^7.1.4",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
Expand Down Expand Up @@ -65,7 +66,18 @@
"lint:tests": "eslint ./test --cache --ignore-pattern .gitignore",
"lint:css": "sass-lint -v -f stylish",
"dev": "webpack-dev-server",
"test": "jest && codecov"
"test": "jest && codecov",
"preversion": "npm test",
"postversion": "npm run build && git add -A static && node ./zip-release.js && git push && git push --tags",
},
"release": {
"files": [
"demos/**/**",
"static/**/**",
"*.html",
"LICENSE",
"README.md"
]
},
"jest": {
"collectCoverage": true
Expand Down
21 changes: 21 additions & 0 deletions zip-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable no-console */
const fs = require('fs');
const archiver = require('archiver');
const pck = require('./package.json');

const output = fs.createWriteStream(`${__dirname}/${pck.name}.zip`);
const archive = archiver('zip', { zlib: { level: 9 } });

output.on('close', () => {
console.log(`${archive.pointer()} total bytes`);
});

archive.on('error', err => {
throw err;
});

archive.pipe(output);

pck.release.files.forEach(f => archive.glob(f));

archive.finalize();

0 comments on commit b1e0320

Please sign in to comment.