Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,32 @@ module.exports = {
"@semantic-release/commit-analyzer", // Detects the release type (major, minor, patch)
"@semantic-release/release-notes-generator", // Generates release notes
"@semantic-release/changelog", // Updates CHANGELOG.md
[
{
// Hook to update pubspec.yaml
prepare: (pluginConfig, context) => {
const version = context.nextRelease.version;
const filePath = "pubspec.yaml";

let pubspec = fs.readFileSync(filePath, "utf8");
pubspec = pubspec.replace(/^version: .*/m, `version: ${version}`);
fs.writeFileSync(filePath, pubspec);

context.logger.log(
`✅ pubspec.yaml actualizado a version: ${version}`
);
},
},
],
[
"@semantic-release/git", // Commits CHANGELOG and bumps version if needed
{
assets: ["CHANGELOG.md", "pubspec.yaml"],
message:
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
"@semantic-release/github", // Publishes to GitHub Releases
"@semantic-release/git", // Commits CHANGELOG and bumps version if needed
],
changelogFile: "CHANGELOG.md",
preset: "conventionalcommits",
Expand Down