|
| 1 | +name: 📜 Changelog Builder |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - redot-* |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: write |
| 9 | + |
| 10 | +env: |
| 11 | + STABLE_SINCE_REDOT_VERSION: 4.4 |
| 12 | + |
| 13 | +jobs: |
| 14 | + prepare-release: |
| 15 | + name: Prepare Release |
| 16 | + if: startsWith(github.ref, 'refs/tags/') |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Build Changelog |
| 20 | + id: build_changelog |
| 21 | + uses: mikepenz/release-changelog-builder-action@v5 |
| 22 | + env: |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + with: |
| 25 | + configurationJson: | |
| 26 | + { |
| 27 | + "base_branches": ["4.3"], |
| 28 | + "custom_placeholders": [ |
| 29 | + { |
| 30 | + "name": "RELEASE_VERSION", |
| 31 | + "source": "TO_TAG", |
| 32 | + "transformer": { |
| 33 | + "method": "regexr", |
| 34 | + "pattern": "redot-(\\d+\\.\\d+(?:\\.\\d+)?)-(?:(alpha|beta|rc)\\.(\\d+)|(stable))", |
| 35 | + "target": "$1 $2$4 $3" |
| 36 | + } |
| 37 | + }, |
| 38 | + { |
| 39 | + "name": "SIMPLIFIED_TITLE", |
| 40 | + "source": "TITLE", |
| 41 | + "transformer": { |
| 42 | + "pattern": "^(\\[\\d+\\.\\d+\\] )", |
| 43 | + "target": "" |
| 44 | + } |
| 45 | + } |
| 46 | + ], |
| 47 | + "categories": [ |
| 48 | + { |
| 49 | + "title": "### Enhancements & Features", |
| 50 | + "labels": ["enhancement"], |
| 51 | + "exhaustive": true, |
| 52 | + "rules": [ |
| 53 | + { |
| 54 | + "on_property": "title", |
| 55 | + "pattern": "^(?!(\\[\\d+\\.\\d+\\] )?Cherry-picks.*)" |
| 56 | + } |
| 57 | + ], |
| 58 | + "consume": true |
| 59 | + }, |
| 60 | + { |
| 61 | + "title": "### Bug Fixes", |
| 62 | + "labels": ["bug"], |
| 63 | + "exhaustive": true, |
| 64 | + "rules": [ |
| 65 | + { |
| 66 | + "on_property": "title", |
| 67 | + "pattern": "^(?!(\\[\\d+\\.\\d+\\] )?Cherry-picks.*)" |
| 68 | + } |
| 69 | + ], |
| 70 | + "consume": true |
| 71 | + }, |
| 72 | + { |
| 73 | + "title": "### Cherry-picks", |
| 74 | + "rules": [ |
| 75 | + { |
| 76 | + "on_property": "title", |
| 77 | + "pattern": "^(\\[\\d+\\.\\d+\\] )?Cherry-picks" |
| 78 | + }, |
| 79 | + { |
| 80 | + "on_property": "body", |
| 81 | + "pattern": "\\(cherry picked from commit " |
| 82 | + } |
| 83 | + ], |
| 84 | + "consume": true |
| 85 | + }, |
| 86 | + { |
| 87 | + "title": "### Godot Syncs", |
| 88 | + "labels": ["merge:godot"], |
| 89 | + "consume": true |
| 90 | + } |
| 91 | + ], |
| 92 | + "template": "## Release Notes for Redot #{{RELEASE_VERSION}}\nWe're excited to announce the release of our latest version, featuring a host of enhancements and fixes. Here's what's new:\n\n#{{CHANGELOG}}\n**Full Changelog**: #{{RELEASE_DIFF}}", |
| 93 | + "pr_template": "* #{{SIMPLIFIED_TITLE}} by #{{AUTHOR}} in #{{URL}}", |
| 94 | + "max_pull_requests": 1000, |
| 95 | + "max_back_track_time_days": 365 |
| 96 | + } |
| 97 | +
|
| 98 | + - name: Build Stable Changelog |
| 99 | + if: endsWith(github.ref, '-stable') |
| 100 | + id: build_stable_changelog |
| 101 | + uses: mikepenz/release-changelog-builder-action@v5 |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 104 | + with: |
| 105 | + fromTag: redot-${{env.STABLE_SINCE_REDOT_VERSION}}-stable |
| 106 | + configurationJson: | |
| 107 | + { |
| 108 | + "base_branches": ["4.3"], |
| 109 | + "custom_placeholders": [ |
| 110 | + { |
| 111 | + "name": "RELEASE_VERSION", |
| 112 | + "source": "TO_TAG", |
| 113 | + "transformer": { |
| 114 | + "method": "regexr", |
| 115 | + "pattern": "redot-(\\d+\\.\\d+(?:\\.\\d+)?)-(?:(alpha|beta|rc)\\.(\\d+)|(stable))", |
| 116 | + "target": "$1 $2$4 $3" |
| 117 | + } |
| 118 | + }, |
| 119 | + { |
| 120 | + "name": "SIMPLIFIED_TITLE", |
| 121 | + "source": "TITLE", |
| 122 | + "transformer": { |
| 123 | + "pattern": "^(\\[\\d+\\.\\d+\\] )", |
| 124 | + "target": "" |
| 125 | + } |
| 126 | + } |
| 127 | + ], |
| 128 | + "categories": [ |
| 129 | + { |
| 130 | + "title": "### Enhancements & Features", |
| 131 | + "labels": ["enhancement"], |
| 132 | + "exhaustive": true, |
| 133 | + "rules": [ |
| 134 | + { |
| 135 | + "on_property": "title", |
| 136 | + "pattern": "^(?!(\\[\\d+\\.\\d+\\] )?Cherry-picks.*)" |
| 137 | + } |
| 138 | + ], |
| 139 | + "consume": true |
| 140 | + }, |
| 141 | + { |
| 142 | + "title": "### Bug Fixes", |
| 143 | + "labels": ["bug"], |
| 144 | + "exhaustive": true, |
| 145 | + "rules": [ |
| 146 | + { |
| 147 | + "on_property": "title", |
| 148 | + "pattern": "^(?!(\\[\\d+\\.\\d+\\] )?Cherry-picks.*)" |
| 149 | + } |
| 150 | + ], |
| 151 | + "consume": true |
| 152 | + }, |
| 153 | + { |
| 154 | + "title": "### Cherry-picks", |
| 155 | + "rules": [ |
| 156 | + { |
| 157 | + "on_property": "title", |
| 158 | + "pattern": "^(\\[\\d+\\.\\d+\\] )?Cherry-picks" |
| 159 | + }, |
| 160 | + { |
| 161 | + "on_property": "body", |
| 162 | + "pattern": "\\(cherry picked from commit " |
| 163 | + } |
| 164 | + ], |
| 165 | + "consume": true |
| 166 | + }, |
| 167 | + { |
| 168 | + "title": "### Godot Syncs", |
| 169 | + "labels": ["merge:godot"], |
| 170 | + "consume": true |
| 171 | + } |
| 172 | + ], |
| 173 | + "template": "## Since Redot ${{env.STABLE_SINCE_REDOT_VERSION}}\n\n#{{CHANGELOG}}\n**Full Changelog**: #{{RELEASE_DIFF}}", |
| 174 | + "pr_template": "* #{{SIMPLIFIED_TITLE}} by #{{AUTHOR}} in #{{URL}}", |
| 175 | + "max_pull_requests": 1000, |
| 176 | + "max_back_track_time_days": 365 |
| 177 | + } |
| 178 | +
|
| 179 | + - name: Create Release Draft |
| 180 | + uses: softprops/action-gh-release@v2 |
| 181 | + with: |
| 182 | + body: | |
| 183 | + ${{steps.build_changelog.outputs.changelog}} |
| 184 | + ${{steps.build_stable_changelog.outputs.changelog}} |
| 185 | + draft: true |
0 commit comments