From aab31a5edb7c8c96723677adbc675b1cacc2749c Mon Sep 17 00:00:00 2001 From: SebClem Date: Wed, 11 Sep 2024 14:56:16 +0200 Subject: [PATCH] Add auto realease creation --- .auto-changelog | 9 +++---- .github/changlog_template.hbs | 45 ++++++++++++++++--------------- .github/workflows/build_addon.yml | 17 +++++++++++- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/.auto-changelog b/.auto-changelog index cae3591..87d2492 100644 --- a/.auto-changelog +++ b/.auto-changelog @@ -1,6 +1,5 @@ { - "output": "stdout", - "template": ".github/changlog_template.hbs", - "unreleased": true, - "commitLimit": false - } + "template": ".github/changlog_template.hbs", + "unreleased": true, + "commitLimit": false +} \ No newline at end of file diff --git a/.github/changlog_template.hbs b/.github/changlog_template.hbs index 3cb92e0..468b628 100644 --- a/.github/changlog_template.hbs +++ b/.github/changlog_template.hbs @@ -1,5 +1,26 @@ {{#each releases}} {{#if @first}} + {{#if href}} + ## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}} + {{else}} + ## {{title}}{{#if tag}} - {{isoDate}}{{/if}} + {{/if}} + + {{#commit-list commits heading='## 💥 Breaking changes' message=':boom:'}} + - {{subject}} [`{{shorthash}}`]({{href}}) {{setVar "fix" "true"}} + {{/commit-list}} + {{#unless @root.fix }} + {{#commit-list merges heading='## 💥 Breaking changes' message=':boom:'}} + - {{message}} [`{{id}}`]({{href}}) `{{author}}` + {{/commit-list}} + {{/unless}} + {{#if @root.fix }} + {{#commit-list merges heading='' message=':boom:'}} + - {{message}} [`{{id}}`]({{href}}) `{{author}}` + {{/commit-list}} + {{/if}} + + {{#commit-list commits heading='## 🚑 Fixs' message=':ambulance:'}} - {{subject}} [`{{shorthash}}`]({{href}}) {{setVar "fix" "true"}} {{/commit-list}} @@ -15,39 +36,21 @@ {{/if}} - - {{#commit-list commits heading='## 🔨 Changes' message=':hammer:|:heavy_plus_sign:'}} + {{#commit-list commits heading='## ✏️ Other changes' exclude=':boom:|:ambulance:|:heavy_plus_sign:'}} - {{subject}} [`{{shorthash}}`]({{href}}) {{setVar "change" "true"}} {{/commit-list}} {{#unless @root.change }} - {{#commit-list merges heading='## 🔨 Changes' message=':hammer:|:heavy_plus_sign:'}} + {{#commit-list merges heading='## ✏️ Other changes' exclude=':boom:|:ambulance:|:heavy_plus_sign:'}} - {{message}} [`{{id}}`]({{href}}) `{{author}}` {{/commit-list}} {{/unless}} {{#if @root.change }} - {{#commit-list merges heading='' message=':hammer:|:heavy_plus_sign:'}} + {{#commit-list merges heading='' exclude=':boom:|:ambulance:|:heavy_plus_sign:'}} - {{message}} [`{{id}}`]({{href}}) `{{author}}` {{/commit-list}} {{/if}} - - {{#commit-list commits heading='## ✏ Enhancements' message=':pencil2:'}} - - {{subject}} [`{{shorthash}}`]({{href}}) {{setVar "enhanc" "true"}} - {{/commit-list}} - {{#unless @root.enhanc }} - {{#commit-list merges heading='## ✏ Enhancements' message=':pencil2:'}} - - {{message}} [`{{id}}`]({{href}}) `{{author}}` - {{/commit-list}} - {{/unless}} - {{#if @root.enhanc }} - {{#commit-list merges heading='' message=':pencil2:'}} - - {{message}} [`{{id}}`]({{href}}) `{{author}}` - {{/commit-list}} - {{/if}} - - - {{#commit-list commits heading='## ⬆️ Dependency updates' message=':arrow_up:'}} - {{subject}} [`{{shorthash}}`]({{href}}) {{setVar "dep" "true"}} {{/commit-list}} diff --git a/.github/workflows/build_addon.yml b/.github/workflows/build_addon.yml index e094932..1377025 100644 --- a/.github/workflows/build_addon.yml +++ b/.github/workflows/build_addon.yml @@ -186,7 +186,7 @@ jobs: done cosign sign --yes ${images} - update_main_ha_repository: + update_branch_ha_repository: name: Update HA addon repository runs-on: ubuntu-latest needs: @@ -248,3 +248,18 @@ jobs: git add . git commit -m "Update Nextcloud Backup to ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}" git push + + draft-release: + name: Draft release + runs-on: ubuntu-latest + needs: + - build-dockers + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Get changelog + run: npx auto-changelog --handlebars-setup .github/custom-handlebars.js + - name: Create release + uses: softprops/action-gh-release@v2 + with: + body: CHANGELOG.md + draft: true