Skip to content

Commit 254ccc5

Browse files
committed
fix: version bumping
1 parent 44bb804 commit 254ccc5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.releaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@
2020
],
2121
"@semantic-release/git",
2222
"@semantic-release/github"
23+
],
24+
"assets": [
25+
"hoddor/Cargo.toml",
26+
"package.json",
27+
"CHANGELOG.md"
2328
]
2429
}

scripts/set-version.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const fs = require("fs");
22
const path = require("path");
33

4-
const version = process.env.npm_package_version;
4+
const version = process.argv[2];
55
if (!version) {
6-
console.error("Missing version from npm");
6+
console.error("Missing version argument");
77
process.exit(1);
88
}
99

@@ -16,4 +16,10 @@ const newContent = content.replace(
1616
);
1717

1818
fs.writeFileSync(cargoPath, newContent);
19-
console.log(`🔧 Updated Cargo.toml to version ${version}`);
19+
20+
const packageJsonPath = path.join(__dirname, "../package.json");
21+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
22+
packageJson.version = version;
23+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n");
24+
25+
console.log(`✅ Updated Cargo.toml and package.json to version ${version}`);

0 commit comments

Comments
 (0)