@@ -4,8 +4,32 @@ module.exports = {
4
4
"@semantic-release/commit-analyzer" , // Detects the release type (major, minor, patch)
5
5
"@semantic-release/release-notes-generator" , // Generates release notes
6
6
"@semantic-release/changelog" , // Updates CHANGELOG.md
7
+ [
8
+ {
9
+ // Hook to update pubspec.yaml
10
+ prepare : ( pluginConfig , context ) => {
11
+ const version = context . nextRelease . version ;
12
+ const filePath = "pubspec.yaml" ;
13
+
14
+ let pubspec = fs . readFileSync ( filePath , "utf8" ) ;
15
+ pubspec = pubspec . replace ( / ^ v e r s i o n : .* / m, `version: ${ version } ` ) ;
16
+ fs . writeFileSync ( filePath , pubspec ) ;
17
+
18
+ context . logger . log (
19
+ `✅ pubspec.yaml actualizado a version: ${ version } `
20
+ ) ;
21
+ } ,
22
+ } ,
23
+ ] ,
24
+ [
25
+ "@semantic-release/git" , // Commits CHANGELOG and bumps version if needed
26
+ {
27
+ assets : [ "CHANGELOG.md" , "pubspec.yaml" ] ,
28
+ message :
29
+ "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" ,
30
+ } ,
31
+ ] ,
7
32
"@semantic-release/github" , // Publishes to GitHub Releases
8
- "@semantic-release/git" , // Commits CHANGELOG and bumps version if needed
9
33
] ,
10
34
changelogFile : "CHANGELOG.md" ,
11
35
preset : "conventionalcommits" ,
0 commit comments