Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
codenirvana committed Sep 13, 2023
1 parent 7275b6b commit ba2d3e5
Show file tree
Hide file tree
Showing 3 changed files with 1,516 additions and 3 deletions.
30 changes: 30 additions & 0 deletions npm/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env node
// ---------------------------------------------------------------------------------------------------------------------
// This script is intended to automate the versioning and changelog generation process for a release.
// ---------------------------------------------------------------------------------------------------------------------

const shipit = require('@postman/shipit'),

// npm run release [true] [beta]
[pushToOrigin, preReleaseSuffix] = process.argv.splice(2);

// only support `beta` suffix
if (preReleaseSuffix && preReleaseSuffix !== 'beta') {
throw new Error(`Can't prerelease with \`${preReleaseSuffix}\` suffix.`);
}

// 🚢 Just Ship It!
shipit({
mainBranch: 'main',
// don't push to origin unless explicitly set
pushToOrigin: pushToOrigin === 'true',
// prerelease suffix, if any
preReleaseSuffix: preReleaseSuffix,
// make sure that following dependencies are up to date
dependencyList: []
}).then((version) => {
console.info('🚀', version);
}).catch((err) => {
console.error('🔥', err);
process.exit(1);
});
Loading

0 comments on commit ba2d3e5

Please sign in to comment.