Skip to content

Commit 5b7a38e

Browse files
chore: @fuel-ts/recipes now correctly bumped on release (#3685)
* chore: fix recipe version bumping in CI * changeset * Update .changeset/empty-pigs-talk.md * chore: ensure paths exist
1 parent 6f32228 commit 5b7a38e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.changeset/empty-pigs-talk.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
4+
chore: `@fuel-ts/recipes` now correctly bumped on release

scripts/changeset/changeset-version-with-docs.ts

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { execSync } from 'child_process';
44
import { error } from 'console';
5+
import { existsSync } from 'fs';
56

67
(() => {
78
try {
@@ -23,25 +24,34 @@ import { error } from 'console';
2324
*/
2425
execSync(`pnpm -C packages/versions build`);
2526

26-
// Invoke fuels' build:proxy script (will rewrite header versions in generated files)
27-
execSync(`pnpm -C packages/fuels build:proxy`);
27+
// Invoke recipes build script (will rewrite header versions in generated files)
28+
execSync(`pnpm -C packages/recipes build`);
2829

2930
// Checks if the commands above generated git changes
3031
const versionsFilePath = `packages/versions/src/lib/getBuiltinVersions.ts`;
31-
const proxyDirPath = `packages/fuels/src/cli/commands/deploy/proxy`;
32+
const recipeDirPath = `packages/recipes/src`;
33+
34+
// Ensure paths exist
35+
const paths = [versionsFilePath, recipeDirPath];
36+
if (!paths.every(existsSync)) {
37+
throw new Error(
38+
`Paths do not exist: ${paths.filter((path) => !existsSync(path)).join(', ')}`
39+
);
40+
}
3241

3342
const versionsChanged = !!execSync(`git status --porcelain ${versionsFilePath}`)
3443
.toString()
3544
.trim();
3645

37-
const proxyChanged = !!execSync(`git status --porcelain ${proxyDirPath}`).toString().trim();
46+
const proxyChanged = !!execSync(`git status --porcelain ${recipeDirPath}`).toString().trim();
3847

3948
// If they did, add and commit the changes
4049
if (versionsChanged || proxyChanged) {
41-
execSync(`git add ${versionsFilePath} ${proxyDirPath}`);
50+
execSync(`git add ${versionsFilePath} ${recipeDirPath}`);
4251
execSync(`git commit -m"ci(scripts): update versions"`);
4352
}
4453
} catch (err) {
4554
error(err.toString());
55+
process.exit(1);
4656
}
4757
})();

0 commit comments

Comments
 (0)