forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a new shell script to launch release-docs - Release docs is pretty much the same are release, but doesn't run global build and tests. Instead it runs the doc-only-build - Split some of the currently existing scripts in order to be able to reuse part of them - Updated CONTRIBUTING.md
- Loading branch information
Showing
8 changed files
with
130 additions
and
17 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,8 @@ | ||
#!/usr/bin/env node | ||
/* eslint no-var: 0 */ | ||
require('../register-babel'); | ||
var path = require('path'); | ||
var nodeModulesBin = path.resolve(__dirname, '../node_modules/.bin'); | ||
process.env.PATH = nodeModulesBin + ':' + process.env.PATH; | ||
require('./release-docs-scripts/release-docs'); | ||
|
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,48 @@ | ||
/* eslint no-process-exit: 0 */ | ||
|
||
import 'colors'; | ||
import { exec } from 'child-process-promise'; | ||
|
||
import preConditions from '../release-scripts/pre-conditions'; | ||
import versionBump from '../release-scripts/version-bump'; | ||
import repoRelease from '../release-scripts/repo-release'; | ||
import tag from '../release-scripts/tag'; | ||
import { lint } from '../release-scripts/test'; | ||
|
||
import { repoRoot, docsRoot, docsRepo, tmpDocsRepo } from '../release-scripts/constants'; | ||
|
||
let version; | ||
|
||
const versionBumpOptions = { | ||
preid: 'docs' | ||
}; | ||
|
||
preConditions() | ||
.then(lint) | ||
.then(versionBump(repoRoot, versionBumpOptions)) | ||
.then(v => { version = v; }) | ||
.then(() => { | ||
return exec('npm run docs-build') | ||
.catch(err => { | ||
console.log('Docs-build failed, reverting version bump'.red); | ||
return exec('git reset HEAD .') | ||
.then(() => exec('git checkout package.json')) | ||
.then(() => console.log('Version bump reverted'.red)) | ||
.then(() => { | ||
throw err; | ||
}); | ||
}); | ||
}) | ||
.then(() => exec(`git commit -m "Release v${version}"`)) | ||
.then(() => Promise.all([ | ||
tag(version), | ||
repoRelease(docsRepo, docsRoot, tmpDocsRepo, version) | ||
])) | ||
.then(() => console.log('Version '.cyan + `v${version}`.green + ' released!'.cyan)) | ||
.catch(err => { | ||
if (!err.__handled) { | ||
console.error(err.message.red); | ||
} | ||
|
||
process.exit(1); | ||
}); |
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,18 @@ | ||
import path from 'path'; | ||
|
||
const repoRoot = path.resolve(__dirname, '../../'); | ||
|
||
const bowerRepo = 'git@github.com:react-bootstrap/react-bootstrap-bower.git'; | ||
const docsRepo = 'git@github.com:react-bootstrap/react-bootstrap.github.io.git'; | ||
|
||
const bowerRoot = path.join(repoRoot, 'amd/'); | ||
const docsRoot = path.join(repoRoot, 'docs-built/'); | ||
|
||
const tmpBowerRepo = path.join(repoRoot, 'tmp-bower-repo'); | ||
const tmpDocsRepo = path.join(repoRoot, 'tmp-docs-repo'); | ||
|
||
export { | ||
repoRoot, | ||
bowerRepo, bowerRoot, tmpBowerRepo, | ||
docsRoot, docsRepo, tmpDocsRepo, | ||
}; |
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import { exec } from 'child-process-promise'; | ||
import tag from './tag'; | ||
|
||
export default (version) => { | ||
console.log('Releasing: '.cyan + 'npm module'.green); | ||
|
||
return exec(`git tag -a --message=v${version} v${version}`) | ||
.then(() => exec(`git push`)) | ||
.then(() => exec(`git push --tags`)) | ||
return tag() | ||
.then(() => exec('npm publish')) | ||
.then(() => console.log('Released: '.cyan + 'npm module'.green)); | ||
}; |
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,10 @@ | ||
import { exec } from 'child-process-promise'; | ||
|
||
export default (version) => { | ||
console.log('Tagging: '.cyan + `v${version}`.green); | ||
|
||
return exec(`git tag -a --message=v${version} v${version}`) | ||
.then(() => exec(`git push`)) | ||
.then(() => exec(`git push --tags`)) | ||
.then(() => console.log('Tagged: '.cyan + `v${version}`.green)); | ||
}; |
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