-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
simonepri
committed
Nov 30, 2017
1 parent
980d568
commit e9a322d
Showing
8 changed files
with
109 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const execa = require('execa'); | ||
|
||
const gulp = require('gulp'); | ||
const gutil = require('gulp-util'); | ||
|
||
const Confirm = require('prompt-confirm'); | ||
|
||
const folders = require('../folders'); | ||
|
||
const sizes = require('../resolutions'); | ||
const maps = require('../maps'); | ||
|
||
/** | ||
* Publish on npm. | ||
*/ | ||
gulp.task('npm', async () => { | ||
let ans; | ||
const pkn = maps.length * Object.keys(sizes).length; | ||
await new Confirm('Are you sure to want to publish all the ' + pkn + ' npm packages?') | ||
.run().then(answer => { | ||
ans = answer; | ||
}); | ||
|
||
if (!ans) { | ||
gutil.log('Release process interrupted!'); | ||
return; | ||
} | ||
|
||
for (const map of maps) { | ||
const mapDir = path.join(folders.pkgsDir, 'npm', map); | ||
for (const size of Object.keys(sizes)) { | ||
gutil.log('Publishing @geo-maps/' + [map, size].join('-')); | ||
|
||
const packageDir = path.join(mapDir, size); | ||
const cmd = 'npm pack --access public'; | ||
const proc = execa.shell(cmd, {cwd: packageDir}); | ||
proc.stdout.pipe(process.stdout); | ||
process.stdin.pipe(proc.stdin); | ||
// eslint-disable-next-line no-await-in-loop | ||
await proc; | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
|
||
/** | ||
* Execute the whole publish process. | ||
*/ | ||
gulp.task('publish', gulp.series( | ||
'packages', | ||
'npm' | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
|
||
/** | ||
* Execute the whole release process. | ||
*/ | ||
gulp.task('release', gulp.series( | ||
'artifacts', | ||
'upload' | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const version = require('project-version'); | ||
|
||
const gulp = require('gulp'); | ||
const release = require('gulp-github-release'); | ||
|
||
const folders = require('../folders'); | ||
|
||
/** | ||
* Upload artifacts on GitHub | ||
*/ | ||
gulp.task('upload', () => { | ||
const GITHUB_TOKEN = process.env.GITHUB_TOKEN; | ||
|
||
if (!GITHUB_TOKEN) { | ||
throw new Error('Environment variable GITHUB_TOKEN is required for GitHub releases.'); | ||
} | ||
gulp.src(path.join(folders.distDir, '*')) | ||
.pipe( | ||
release({ | ||
token: GITHUB_TOKEN, | ||
name: 'Release ' + version, | ||
draft: true, | ||
manifest: require('../../package.json') | ||
}) | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.