Skip to content

Commit 6d231f4

Browse files
committed
🚧 Build changelog to include in release
1 parent 3ea4e9e commit 6d231f4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
contents: write
1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
fetch-tags: true
1417
- name: Set up JDK 17
1518
uses: actions/setup-java@v4
1619
with:
@@ -115,11 +118,22 @@ jobs:
115118
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.forge }}
116119
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.fabric }}
117120
gpg --batch --yes --passphrase "${{ env.SIGNING_PASSPHRASE }}" --armor --detach-sign ${{ steps.artifacts.outputs.neoforge }}
121+
- name: Create Changelog Files
122+
run: |
123+
echo "### Technical Changelog:" >> RELEASE_BODY.md
124+
latest_tag=$(git describe --tags --abbrev=0)
125+
previous_tag=$(git describe --tags --abbrev=0 --exclude=$latest_tag)
126+
git log "$previous_tag..$latest_tag^" --oneline --pretty="- %s (%H)" >> RELEASE_BODY.md
127+
echo "### Download:" >> RELEASE_BODY.md
128+
echo "- Official Website: https://mrcrayfish.com/mods/${{ steps.mod_id.outputs.value }}" >> RELEASE_BODY.md
129+
echo "- CurseForge: https://curseforge.com/minecraft/mc-mods/controllable" >> RELEASE_BODY.md
130+
git log "$previous_tag..$latest_tag^" --oneline --pretty="%s" > CHANGELOG.txt
118131
- name: Create Release
119132
uses: ncipollo/release-action@v1
120133
with:
121134
name: '${{ steps.mc_version.outputs.value }}-${{ steps.mod_version.outputs.value }}'
122-
artifacts: "${{ steps.artifacts.outputs.forge }},${{ steps.artifacts.outputs.forge }}.asc,${{ steps.artifacts.outputs.fabric }},${{ steps.artifacts.outputs.fabric }}.asc,${{ steps.artifacts.outputs.neoforge }},${{ steps.artifacts.outputs.neoforge }}.asc"
135+
artifacts: "${{ steps.artifacts.outputs.forge }},${{ steps.artifacts.outputs.forge }}.asc,${{ steps.artifacts.outputs.fabric }},${{ steps.artifacts.outputs.fabric }}.asc,${{ steps.artifacts.outputs.neoforge }},${{ steps.artifacts.outputs.neoforge }}.asc,CHANGELOG.txt"
136+
bodyFile: "RELEASE_BODY.md"
123137
- name: Upload Forge Artifacts
124138
uses: actions/upload-artifact@v4
125139
with:

0 commit comments

Comments
 (0)