MCPcopy
hub / github.com/codeceptjs/CodeceptJS / release

Function release

runok.cjs:459–483  ·  view source on GitHub ↗
(releaseType = null)

Source from the content-addressed store, hash-verified

457 },
458
459 async release(releaseType = null) {
460 const packageInfo = JSON.parse(fs.readFileSync('package.json'))
461 // Releases CodeceptJS. You can pass in argument "patch", "minor", "major" to update package.json
462 if (releaseType) {
463 packageInfo.version = semver.inc(packageInfo.version, releaseType)
464 fs.writeFileSync('package.json', JSON.stringify(packageInfo))
465 await git(cmd => {
466 cmd.add('package.json')
467 cmd.commit('-m "version bump"')
468 })
469 }
470 // publish a new release on npm. Update version in package.json!
471 const version = packageInfo.version
472 await this.docs()
473 await this.def()
474 await this.publishSite()
475 await git(cmd => {
476 cmd.pull()
477 cmd.tag(version)
478 cmd.push('origin 3.x --tags')
479 })
480 await exec('rm -rf docs/wiki/.git')
481 await exec('npm publish')
482 console.log('-- RELEASED --')
483 },
484
485 async versioning() {
486 const semver = require('semver')

Callers 2

withLockFunction · 0.50
withLockFunction · 0.50

Calls 4

pushMethod · 0.80
logMethod · 0.80
addMethod · 0.45
tagMethod · 0.45

Tested by

no test coverage detected