19
19
contents : write
20
20
outputs :
21
21
commit_count : ${{ steps.shared_publish_info.outputs.commit_count }}
22
- github_changelog : ${{ steps.shared_publish_info .outputs.github_changelog }}
22
+ github_changelog : ${{ steps.changelog .outputs.result }}
23
23
github_tag : ${{ steps.shared_publish_info.outputs.github_tag }}
24
24
mod_name : ${{ steps.shared_publish_info.outputs.mod_name }}
25
25
mod_version : ${{ steps.shared_publish_info.outputs.mod_version }}
55
55
56
56
if [ "${{ inputs.publish_type }}" == 'release' ]
57
57
then
58
- github_changelog=$(printf '%q' "${{ github.event.release.body }}")
59
58
github_tag=${{ github.event.ref }}
60
59
release_title=${{ github.event.release.name }}
61
60
elif [ "${{ inputs.publish_type }}" == "dev" ]
@@ -72,34 +71,45 @@ jobs:
72
71
github_tag="$REPO_OWNER/${{ github.ref_name }}.$commit_count"
73
72
release_title="[CI#${{ github.run_number }}]$mod_name $mod_full_version (Fork)"
74
73
fi
75
-
76
- github_changelog="**This version is automatically released by CI Build**
77
-
78
- Latest commit log:
79
-
80
- $(printf '%q' '${{ github.event.head_commit.message }}')"
81
74
else
82
75
echo Unknown publish type ${{ inputs.publish_type }}
83
76
exit 1
84
77
fi
85
78
86
79
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT
87
- echo "github_changelog<<EOF
88
- $github_changelog
89
- EOF" >> "$GITHUB_OUTPUT"
90
80
echo "commit_count=$commit_count" >> $GITHUB_OUTPUT
91
81
echo "github_tag=$github_tag" >> $GITHUB_OUTPUT
92
82
echo "mod_name=$mod_name" >> $GITHUB_OUTPUT
93
83
echo "mod_version=$mod_version" >> $GITHUB_OUTPUT
94
84
echo "mod_full_version=$mod_full_version" >> $GITHUB_OUTPUT
95
85
echo "release_title=$release_title" >> $GITHUB_OUTPUT
86
+ - name : Prepare changelog
87
+ uses : actions/github-script@v7
88
+ id : changelog
89
+ with :
90
+ script : |
91
+ if ('${{ inputs.publish_type }}' === 'release') {
92
+ return process.env.CHANGELOG;
93
+ } else {
94
+ return process.env.CHANGELOG_DEV;
95
+ }
96
+ result-encoding : string
97
+ env :
98
+ CHANGELOG : |-
99
+ ${{ github.event.release.body }}
100
+ CHANGELOG_DEV : |-
101
+ This version is automatically released by CI Build**
102
+
103
+ Latest commit log:
104
+
105
+ ${{ github.event.head_commit.message }}
96
106
- name : Publish Minecraft Mods (Dev Channel)
97
107
if : ${{ inputs.publish_type == 'dev' }}
98
108
uses :
Kir-Antipov/[email protected]
99
109
with :
100
110
github-tag : ${{ steps.shared_publish_info.outputs.github_tag }}
101
111
github-token : ${{ secrets.GITHUB_TOKEN }}
102
- github-changelog : ${{ steps.shared_publish_info .outputs.github_changelog }}
112
+ github-changelog : ${{ steps.changelog .outputs.result }}
103
113
github-prerelease : true
104
114
files : |
105
115
build-artifacts/magiclib-wrapper/fabric/build/tmp/submods/publish/!(*-@(dev|sources|javadoc|empty)).jar
@@ -168,7 +178,7 @@ jobs:
168
178
echo "name=$FILE_NAME" >> $GITHUB_OUTPUT
169
179
echo "hash=$FILE_HASH" >> $GITHUB_OUTPUT
170
180
cat $GITHUB_OUTPUT
171
- - name : Prepare changelog
181
+ - name : Attach file info to changelog
172
182
uses : actions/github-script@v7
173
183
id : changelog
174
184
with :
0 commit comments