Commit ad6e8964 ad6e896497bb331ebc3a57f3c79ff600fd0b1560 by Vincent Peybernes

#9 Prepare publish - publishing process

1 parent cb379802
Pipeline #29 for ad6e8964 passed in 2 minutes 5 seconds
...@@ -7,6 +7,7 @@ cache: ...@@ -7,6 +7,7 @@ cache:
7 stages: 7 stages:
8 - test 8 - test
9 - build 9 - build
10 - publish
10 11
11 node_test: 12 node_test:
12 stage: test 13 stage: test
...@@ -25,3 +26,17 @@ build: ...@@ -25,3 +26,17 @@ build:
25 script: 26 script:
26 - npm install 27 - npm install
27 - npm run build 28 - npm run build
29
30 publish:
31 stage: publish
32 when: manual
33 only:
34 - master
35 environment:
36 name: npm
37 url: https://www.npmjs.com/package/relative-placement-js
38 script:
39 - npm install
40 - npm version $PUBLISH_VERSION
41 - npm run build
42 - npm publish
...\ No newline at end of file ...\ No newline at end of file
......
1 ### v0.1.0-rc _`2016-12-08`_
2 * Fix algorithm
3 * Improve test
4 * Add readme and licence
5 * Add export management
...\ No newline at end of file ...\ No newline at end of file
...@@ -7,15 +7,24 @@ const distPath = './dist/'; ...@@ -7,15 +7,24 @@ const distPath = './dist/';
7 7
8 var gulp = require('gulp'); 8 var gulp = require('gulp');
9 var babel = require('gulp-babel'); 9 var babel = require('gulp-babel');
10 var replace = require('gulp-replace');
11 var rename = require('gulp-rename');
10 var del = require('del'); 12 var del = require('del');
11 13
14 var package = require('./package.json');
15
12 gulp.task('default', ['build']); 16 gulp.task('default', ['build']);
13 17
14 gulp.task('build',['clean'], ()=>{ 18 gulp.task('build',['clean'], ()=>{
15 return gulp.src(srcPath) 19 return gulp.src(srcPath)
20 .pipe(replace(/RelativePlacement.version = '.+?';/, 'RelativePlacement.version = \''+package.version+'\';'))
21 .pipe(gulp.dest(distPath))
16 .pipe(babel({ 22 .pipe(babel({
17 presets: ['es2015'] 23 presets: ['es2015']
18 })) 24 }))
25 .pipe(rename(path => {
26 path.basename += '-es2015'
27 }))
19 .pipe(gulp.dest(distPath)); 28 .pipe(gulp.dest(distPath));
20 }); 29 });
21 30
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 * @module relativePlacement 3 * @module relativePlacement
4 */ 4 */
5 (function (definition) { 5 (function (definition) {
6
6 // Node export 7 // Node export
7 if(global && module && module.exports) return module.exports = definition(); 8 if(global && module && module.exports) return module.exports = definition();
8 //Browser export 9 //Browser export
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
30 }); 31 });
31 } 32 }
32 33
34 RelativePlacement.version = '0.0.0';
35
33 /** 36 /**
34 * @name addCandidate 37 * @name addCandidate
35 * @param {String} candidateName 38 * @param {String} candidateName
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 "name": "Techniv", 6 "name": "Techniv",
7 "email": "contact@techniv.fr" 7 "email": "contact@techniv.fr"
8 }, 8 },
9 "main": "./lib/relative-placement.js", 9 "main": "./dist/relative-placement.js",
10 10
11 "repository":{ 11 "repository":{
12 "type": "git", 12 "type": "git",
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
19 "devDependencies": { 19 "devDependencies": {
20 "gulp": "*", 20 "gulp": "*",
21 "gulp-babel": "*", 21 "gulp-babel": "*",
22 "gulp-replace": "*",
23 "gulp-rename": "*",
22 "del": "*", 24 "del": "*",
23 "babel-preset-es2015": "*", 25 "babel-preset-es2015": "*",
24 "mocha": "*" 26 "mocha": "*"
......