Skip to content

Commit

Permalink
Fix: [AEA-0000] - use custom release template and schedule release (#202
Browse files Browse the repository at this point in the history
)

## Summary

- Routine Change

### Details

- use custom release template
- schedule weekly release
  • Loading branch information
anthony-nhs committed Sep 3, 2024
1 parent 506192b commit 03c7d15
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cat semantic-release-output.log
exit 1
fi
tagFormat=$(jq -r .tagFormat .releaserc)
tagFormat=$(node -e "const config=require('./release.config.cjs'); console.log(config.tagFormat)")
if [ "${tagFormat}" = "null" ]
then
tagFormat="v\${version}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release to GitHub Packages

on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 3"

jobs:
quality_checks:
Expand Down
80 changes: 0 additions & 80 deletions .releaserc

This file was deleted.

87 changes: 87 additions & 0 deletions release.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

const {readFileSync} = require("fs")

const commitTemplate = readFileSync("./releaseNotesTemplates/commit.hbs").toString()

module.exports = {
branches: [
{
name: "main"
}
],
plugins: [
[
"@semantic-release/commit-analyzer",
{
preset: "eslint",
releaseRules: [
{
reminder: "Please update CONTRIBUTING.md if you change this",
release: false
},
{
tag: "Fix",
release: "patch"
},
{
tag: "Update",
release: "patch"
},
{
tag: "New",
release: "minor"
},
{
tag: "Breaking",
release: "major"
},
{
tag: "Docs",
release: "patch"
},
{
tag: "Build",
release: false
},
{
tag: "Upgrade",
release: "patch"
},
{
tag: "Chore",
release: "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
preset: "eslint",
writerOpts: {
commitPartial: commitTemplate
}
}
],
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md"
}
],
[
"@semantic-release/github",
{
assets: [
{
path: "CHANGELOG.md",
label: "CHANGELOG.md"
}
],
successComment: false,
failComment: false,
failTitle: false
}
]
]
}
3 changes: 3 additions & 0 deletions releaseNotesTemplates/commit.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* {{#if message}}{{message}}{{else}}{{header}}{{/if}}

{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{shortHash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}}
3 changes: 2 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ sonar.host.url=https://sonarcloud.io
sonar.coverage.exclusions=\
**/*.test.*, \
**/jest.config.ts,scripts/*, \
eslint.config.mjs
eslint.config.mjs, \
release.config.cjs
sonar.javascript.lcov.reportPaths=coverage/lcov.info

0 comments on commit 03c7d15

Please sign in to comment.