File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "devDependencies" : {
3
+ "semantic-release-preconfigured-conventional-commits" : " 1.1.17"
4
+ },
5
+ "engines" : {
6
+ "node" : " 18.15"
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ // Load this configuration that provide all the base for working with conventional commits
2
+ const config = require ( 'semantic-release-preconfigured-conventional-commits' )
3
+
4
+ /*
5
+ Commands executed during release.
6
+ It also set an environment variable "release" indicating that the release was successful.
7
+ */
8
+ const publishCommands = `
9
+ git tag -a -f \${nextRelease.version} \${nextRelease.version} -F CHANGELOG.md || exit 2
10
+ git push --force origin \${nextRelease.version} || exit 3
11
+ echo "release_status=released" >> $GITHUB_ENV
12
+ echo "CONTAINER_VERSION="\${nextRelease.version} >> $GITHUB_ENV
13
+ `
14
+ // Only release on branch main
15
+ const releaseBranches = [ "main" ]
16
+
17
+ config . branches = releaseBranches
18
+
19
+ config . plugins . push (
20
+ // Custom release commands
21
+ [ "@semantic-release/exec" , {
22
+ "publishCmd" : publishCommands ,
23
+ } ] ,
24
+ // Release also in GitHub
25
+ [ "@semantic-release/github" , {
26
+ "assets" : [ ]
27
+ } ] ,
28
+ [ "@semantic-release/git" , {
29
+ "assets" : [ "CHANGELOG.md" , "package.json" ] ,
30
+ "message" : "chore(release)!: [skip ci] ${nextRelease.version} released"
31
+ } ]
32
+ )
33
+
34
+ // JS Semantic Release configuration must export the JS configuration object
35
+ module . exports = config
You can’t perform that action at this time.
0 commit comments