Skip to content

Commit

Permalink
Merge pull request #170 from projectsyn/changelog-gen
Browse files Browse the repository at this point in the history
Add changelog generator to workflow
  • Loading branch information
ccremer committed Apr 16, 2021
2 parents f9d8b00 + 56f6cf8 commit 03e7412
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 162 deletions.
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Remove items that do not apply. For completed items, change [ ] to [x].

- [ ] Keep pull requests small so they can be easily reviewed.
- [ ] Update the documentation.
- [ ] Update the ./CHANGELOG.md.
- [ ] Categorize the PR by setting a good title and adding one of the labels:
`bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency`
as they show up in the changelog
- [ ] Link this PR to related issues.

<!--
Expand Down
30 changes: 30 additions & 0 deletions .github/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["enhancement", "feature"]
},
{
"title": "## 🛠️ Minor Changes",
"labels": ["change"]
},
{
"title": "## 🔎 Breaking Changes",
"labels": ["breaking"]
},
{
"title": "## 🐛 Fixes",
"labels": ["bug", "fix"]
},
{
"title": "## 📄 Documentation",
"labels": ["documentation"]
},
{
"title": "## 🔗 Dependency Updates",
"labels": ["dependency"]
}
],
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}"
}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
IMAGE: docker.io/${{ github.repository }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set version latest
if: github.ref == 'refs/heads/master'
run: echo "VERSION=latest" >> $GITHUB_ENV
Expand All @@ -30,3 +32,24 @@ jobs:
run: |
docker login docker.io --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}"
docker push "${IMAGE}:${VERSION}"
- name: Build changelog from PRs with labels
if: startsWith(github.ref, 'refs/tags/v')
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: ".github/changelog-configuration.json"
# PreReleases still get a changelog, but the next full release gets a diff since the last full release,
# combining possible changelogs of all previous PreReleases in between.
# PreReleases show a partial changelog since last PreRelease.
ignorePreReleases: "${{ !contains(github.ref, '-rc') }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{steps.build_changelog.outputs.changelog}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161 changes: 0 additions & 161 deletions CHANGELOG.md

This file was deleted.

3 changes: 3 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"postUpdateOptions": [
"gomodTidy"
],
"labels": [
"dependency"
],
"packageRules": [
{
"packagePatterns": ["^k8s.io", "^sigs.k8s.io"],
Expand Down

0 comments on commit 03e7412

Please sign in to comment.