Skip to content

Commit ba2d3e5

Browse files
committed
Add release script
1 parent 7275b6b commit ba2d3e5

File tree

3 files changed

+1516
-3
lines changed

3 files changed

+1516
-3
lines changed

Diff for: npm/release.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
// ---------------------------------------------------------------------------------------------------------------------
3+
// This script is intended to automate the versioning and changelog generation process for a release.
4+
// ---------------------------------------------------------------------------------------------------------------------
5+
6+
const shipit = require('@postman/shipit'),
7+
8+
// npm run release [true] [beta]
9+
[pushToOrigin, preReleaseSuffix] = process.argv.splice(2);
10+
11+
// only support `beta` suffix
12+
if (preReleaseSuffix && preReleaseSuffix !== 'beta') {
13+
throw new Error(`Can't prerelease with \`${preReleaseSuffix}\` suffix.`);
14+
}
15+
16+
// 🚢 Just Ship It!
17+
shipit({
18+
mainBranch: 'main',
19+
// don't push to origin unless explicitly set
20+
pushToOrigin: pushToOrigin === 'true',
21+
// prerelease suffix, if any
22+
preReleaseSuffix: preReleaseSuffix,
23+
// make sure that following dependencies are up to date
24+
dependencyList: []
25+
}).then((version) => {
26+
console.info('🚀', version);
27+
}).catch((err) => {
28+
console.error('🔥', err);
29+
process.exit(1);
30+
});

0 commit comments

Comments
 (0)