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 20b9318 commit c5b9305
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ 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 "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')"
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' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')"
echo "EOF"
} >> $GITHUB_ENV
- name: Finalize variables
run: |
echo "MOD_VERSION_SHORT=${MOD_VERSION%%-*}" >> $GITHUB_ENV
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 @@ -112,7 +112,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 @@ -140,7 +140,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 c5b9305

Please sign in to comment.