Skip to content

Commit

Permalink
fix: Changelog generation (yet again).
Browse files Browse the repository at this point in the history
  • Loading branch information
arassec committed Dec 30, 2022
1 parent 40fbf47 commit 736db4c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 38 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -10,7 +10,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
Expand Down
87 changes: 50 additions & 37 deletions documentation/pom.xml
Expand Up @@ -210,84 +210,97 @@
</configuration>
</plugin>

<plugin>
<groupId>se.bjurr.gitchangelog</groupId>
<artifactId>git-changelog-maven-plugin</artifactId>
<version>1.95.4</version>
<executions>
<execution>
<id>GenerateGitChangelog</id>
<phase>generate-sources</phase>
<goals>
<goal>git-changelog</goal>
</goals>
<configuration>
<file>docs/user/changelog.md</file>
<templateContent>
<![CDATA[
# Changelog
</plugins>
</build>

<profiles>

<!-- During release: generate the changelog -->
<profile>
<id>release</id>
<build>
<plugins>

<plugin>
<groupId>se.bjurr.gitchangelog</groupId>
<artifactId>git-changelog-maven-plugin</artifactId>
<version>1.95.4</version>
<executions>
<execution>
<id>GenerateGitChangelog</id>
<phase>generate-sources</phase>
<goals>
<goal>git-changelog</goal>
</goals>
<configuration>
<file>docs/user/changelog.md</file>
<templateContent>
<![CDATA[
# Changelog
::: danger Breaking Changes in Minor Versions
During development there will be breaking changes in minor versions until a stable version 1.0.0 is released.
After that, semantic versioning will be used and breaking changes will only occur in major version updates.
:::
{{#tags}}
{{#ifReleaseTag .}}
## [{{name}}](https://github.com/arassec/igor/releases/tag/{{name}}) ({{tagDate .}})
{{#tags}}
{{#ifReleaseTag.}}
## [{{name}}](https://github.com/arassec/igor/releases/tag/{{name}}) ({{tagDate.}})
{{#ifContainsBreaking commits}}
### Breaking changes
{{#commits}}
{{#ifCommitBreaking .}}
- {{#eachCommitScope .}} **{{.}}**:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{#ifCommitBreaking.}}
- {{#eachCommitScope.}} {{.}}:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{/ifCommitBreaking}}
{{/commits}}
{{/ifContainsBreaking}}
{{#ifContainsType commits type='feat'}}
{{#ifContainsType commits type = 'feat'}}
### Features
{{#commits}}
{{#ifCommitType . type = 'feat'}}
- {{#eachCommitScope .}} **{{.}}**:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{#ifCommitType.type = 'feat'}}
- {{#eachCommitScope.}} {{.}}:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}
{{#ifContainsType commits type='fix'}}
{{#ifContainsType commits type = 'fix'}}
### Bug Fixes
{{#commits}}
{{#ifCommitType . type='fix'}}
- {{#eachCommitScope .}} **{{.}}**:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{#ifCommitType.type = 'fix'}}
- {{#eachCommitScope.}} {{.}}:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}
{{#ifContainsType commits type='chore'}}
{{#ifContainsType commits type = 'chore'}}
### Chores
{{#commits}}
{{#ifCommitType . type='chore'}}
- {{#eachCommitScope .}} {{.}}:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{#ifCommitType.type = 'chore'}}
- {{#eachCommitScope.}} {{.}}:{{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
{{/ifCommitType}}
{{/commits}}
{{/ifContainsType}}
{{/ifReleaseTag}}
{{/tags}}
]]>
</templateContent>
</configuration>
</execution>
</executions>
</plugin>
</templateContent>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</plugins>
</build>
</project>

1 comment on commit 736db4c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.