Skip to content

Commit

Permalink
Update changelog trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
Swedz committed Sep 8, 2024
1 parent 2ade9b8 commit 9aae7a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ jobs:
echo "MOD_VERSION=$(echo "$GITHUB_RELEASE_TAG_NAME" | sed -E 's/-[^-]+$//')" >> $GITHUB_ENV
echo "RELEASE_TYPE=$(echo "$GITHUB_RELEASE_TAG_NAME" | grep -oE '(alpha|beta)' || echo "release")" >> $GITHUB_ENV
{
echo "MOD_CHANGELOG_TRIMMED<<EOF"
echo "$(echo "$MOD_CHANGELOG" | sed -E '/^\s*$/d; s#\*\*Full Changelog\*\*: (https?://[^\ ]+)#\[Full Changelog\](\1)#g' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')"
echo "MOD_CHANGELOG_TRIMMED_DISCORD<<EOF"
echo "$(echo "$MOD_CHANGELOG" | sed '/## What'"'"'s Changed/d' | sed 's/## New Contributors/**New Contributors**/g' | sed -E 's/@([a-zA-Z0-9_]+)/`\@\1`/g' | sed -E 's|https://github.com/([^ ]+)/pull/([0-9]+)|[#\2](https://github.com/\1/pull/\2)|g' | sed -E 's|\*\*Full Changelog\*\*: (https://github.com/[^ ]+/compare/[^\s]+)|[Full Changelog](\1)|g' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' | sed 's/\\n\\n/\\n/g')"
echo "EOF"
} >> $GITHUB_ENV
{
echo "MOD_CHANGELOG_TRIMMED_PUBLISH<<EOF"
echo "$(echo "$MOD_CHANGELOG" | sed -E 's/@([a-zA-Z0-9_]+)/`\@\1`/g' | sed -E 's|https://github.com/([^ ]+)/pull/([0-9]+)|[#\2](https://github.com/\1/pull/\2)|g' | sed -E 's|\*\*Full Changelog\*\*: (https://github.com/[^ ]+/compare/[^\s]+)|[Full Changelog](\1)|g')"
echo "EOF"
} >> $GITHUB_ENV
- name: Finalize variables
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/discord_message.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
"id": 205983055,
"name": "Changelog",
"value": "$MOD_CHANGELOG_TRIMMED",
"value": "$MOD_CHANGELOG_TRIMMED_DISCORD",
"inline": false
},
{
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ if (System.getenv("CURSEFORGE_API_KEY")) {
id = project.curseforge_project
releaseType = System.getenv("RELEASE_TYPE")
changelogType = "markdown"
delegate.changelog = System.getenv("MOD_CHANGELOG")
delegate.changelog = System.getenv("MOD_CHANGELOG_TRIMMED_PUBLISH")

def compatible_minecraft_versions = project.compatible_minecraft_versions.split(",")
compatible_minecraft_versions.each { addGameVersion it }
Expand Down Expand Up @@ -154,7 +154,7 @@ if (System.getenv("MODRINTH_API_KEY")) {
versionNumber = "${version}"
versionName = "${project.mod_name} ${version}"
versionType = System.getenv("RELEASE_TYPE")
delegate.changelog = System.getenv("MOD_CHANGELOG")
delegate.changelog = System.getenv("MOD_CHANGELOG_TRIMMED_PUBLISH")

gameVersions = project.compatible_minecraft_versions.split(",").collect { it }
loaders = ["neoforge"]
Expand Down

0 comments on commit 9aae7a3

Please sign in to comment.