Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: [AEA-0000] - custom release notes generator #1229

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
VERSION_TAG=$(git rev-parse --short HEAD)
NEXT_VERSION=$(npx semantic-release --dry-run | grep -i 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
tagFormat=$(jq -r .tagFormat .releaserc)
tagFormat=$(node -e "const config=require('./release.config.js'); console.log(config.tagFormat)")
if [ "${tagFormat}" = "null" ]
then
tagFormat="v\${version}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: |
VERSION_TAG=$(git rev-parse --short HEAD)
NEXT_VERSION=$(npx semantic-release --dry-run | grep -i 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
tagFormat=$(jq -r .tagFormat .releaserc)
tagFormat=$(node -e "const config=require('./release.config.js'); console.log(config.tagFormat)")
if [ "${tagFormat}" = "null" ]
then
tagFormat="v\${version}"
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
LOG_LEVEL: DEBUG
LOG_RETENTION_DAYS: 30
CREATE_INT_RELEASE_NOTES: true
CREATE_INT_RC_RELEASE_NOTES: false
CREATE_INT_RC_RELEASE_NOTES: true
TOGGLE_GET_STATUS_UPDATES: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.INT_CLOUD_FORMATION_DEPLOY_ROLE }}
Expand Down
80 changes: 0 additions & 80 deletions .releaserc

This file was deleted.

87 changes: 87 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const {readFileSync} = require("fs")

const commitTemplate = readFileSync("./releaseNotesTemplates/commit.hbs").toString()
module.exports = {
tagFormat: "v${version}-beta",
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}}
5 changes: 3 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ sonar.host.url=https://sonarcloud.io
sonar.coverage.exclusions=\
**/*.test.*,\
**/jest.config.ts,scripts/*,\
packages/common/testing/*,
packages/common/testing/*, \
eslint.config.mjs, \
**/tests/*
**/tests/*, \
release.config.js

sonar.javascript.lcov.reportPaths=\
packages/capabilityStatement/coverage/lcov.info, \
Expand Down