Преглед изворни кода

Modify GitHub workflow to generate releases

The change covers two aspects: adjusting the release link in the GitHub workflow script and adding configurations for categorizing release notes. The previous release link had misplaced comparison tags which have been corrected. On the other hand, configuration for release notes in 'release.yml' will help in automatically categorizing commit messages based on their labels.
DerSkythe пре 2 година
родитељ
комит
a40c526972
2 измењених фајлова са 22 додато и 1 уклоњено
  1. 21 0
      .github/release.yml
  2. 1 1
      .github/workflows/build-with-firmware.yml

+ 21 - 0
.github/release.yml

@@ -0,0 +1,21 @@
+changelog:
+  exclude:
+    labels:
+      - ignore-for-release
+  categories:
+    - title: Breaking Changes 🛠
+      labels:
+        - breaking-change
+    - title: Exciting New Features 🎉
+      labels:
+        - enhancement
+    - title: Bug fixes🧑‍🔧 🐞
+      labels:
+        - bug
+    - title: Doc improvements 📚
+      labels:
+        - docs
+        - documentation
+    - title: Other Changes
+      labels:
+        - "*"

+ 1 - 1
.github/workflows/build-with-firmware.yml

@@ -232,7 +232,7 @@ jobs:
           $json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
           $tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v${{ env.RELEASE_VERSION }}' }) -ne $null
           if ( $tagExists -eq $false ) {
-            gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f name='v${{ env.RELEASE_VERSION }}' -f body="## What's Changed\r\n**Full Changelog**: https://github.com/${{ env.REPO_SELF }}/compare/${{ env.PREV_TAG }}..v${{ env.RELEASE_VERSION }}" -F draft=true -F prerelease=false -F generate_release_notes=false  
+            gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=false  
             gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases/generate-notes -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f previous_tag_name='${{ env.PREV_TAG }}'
           }          
           gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}