Skip to content

Commit

Permalink
chore: improving relase routine (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya authored Nov 9, 2023
1 parent 8bccd58 commit c02e7b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .changeset/proud-ducks-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
24 changes: 18 additions & 6 deletions scripts/changeset-version-with-docs.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#!/usr/bin/env node

import { execSync } from 'child_process';
import { error } from 'console';

(() => {
// Commit versions generated at pre-build step
execSync(`pnpm -C packages/versions prebuild`);
execSync(`git add packages/versions/src/lib/getBuiltinVersions.ts`);
execSync(`git commit -m"ci(scripts): update versions"`);
try {
// Invoke versions' prebuild script (will rewrite version files if needed)
execSync(`pnpm -C packages/versions prebuild`);

// run changeset version
execSync(`changeset version`);
// Checks git status
const isGitClean = !execSync(`git status --porcelain`).toString().trim();

// Skip adding/committing/releasing stuff if there's nothing new
if (!isGitClean) {
execSync(`git add packages/versions/src/lib/getBuiltinVersions.ts`);
execSync(`git commit -m"ci(scripts): update versions"`);

// Run changeset version
execSync(`changeset version`);
}
} catch (err) {
error(err.toString());
}
})();

0 comments on commit c02e7b7

Please sign in to comment.