Skip to content

Commit

Permalink
Allow using the generated md changelogs for wowi
Browse files Browse the repository at this point in the history
I'm hoping dolby adds something to the details api for what the project expects
or lets me set the markup on upload eventually.

Closes BigWigsMods#91
  • Loading branch information
nebularg committed May 6, 2021
1 parent c91d8d4 commit 3cbe458
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ You can also use a few directives for WoWInterface uploading.
be used instead if set in the .pkgmeta.
- *wowi-convert-changelog* : `yes|no` (defaults to yes) Convert a manual
changelog in Markdown format to BBCode if you have [pandoc](http://pandoc.org/)
installed; otherwise, the manual changelog will be used as-is.
installed; otherwise, the manual changelog will be used as-is. If set to `no`
when using a generated changelog, Markdown will be used instead of BBCode.
**Note**: Markdown support is experimental and needs to be requested on a
per-project basis.

### String replacements

Expand Down
16 changes: 11 additions & 5 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ game_type=
file_type=
file_name="{package-name}-{project-version}{nolib}{classic}"

wowi_markup="bbcode"

## END USER OPTIONS

if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]; then
Expand Down Expand Up @@ -1903,6 +1905,10 @@ else
changelog="CHANGELOG.md"
changelog_markup="markdown"

if [ -n "$wowi_gen_changelog" ] && [ -z "$wowi_convert_changelog" ]; then
wowi_markup="markdown"
fi

start_group "Generating changelog of commits into $changelog" "changelog"

_changelog_range=
Expand Down Expand Up @@ -1974,7 +1980,7 @@ else

# WoWI uses BBCode, generate something usable to post to the site
# the file is deleted on successful upload
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then
wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt"
cat <<- EOF | line_ending_filter > "$wowi_changelog"
[size=5]${project}[/size]
Expand Down Expand Up @@ -2016,7 +2022,7 @@ else

# WoWI uses BBCode, generate something usable to post to the site
# the file is deleted on successful upload
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then
wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt"
cat <<- EOF | line_ending_filter > "$wowi_changelog"
[size=5]${project}[/size]
Expand Down Expand Up @@ -2052,7 +2058,7 @@ else

# WoWI uses BBCode, generate something usable to post to the site
# the file is deleted on successful upload
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ]; then
if [ -n "$addonid" ] && [ -n "$tag" ] && [ -n "$wowi_gen_changelog" ] && [ "$wowi_markup" = "bbcode" ]; then
wowi_changelog="$releasedir/WOWI-$project_version-CHANGELOG.txt"
cat <<- EOF | line_ending_filter > "$wowi_changelog"
[size=5]${project}[/size]
Expand Down Expand Up @@ -2357,7 +2363,7 @@ if [ -z "$skip_zipfile" ]; then
_wowi_args=()
if [ -f "$wowi_changelog" ]; then
_wowi_args+=("-F changelog=<$wowi_changelog")
elif [ -n "$manual_changelog" ]; then
elif [ -n "$manual_changelog" ] || [ "$wowi_markup" = "markdown" ]; then
_wowi_args+=("-F changelog=<$pkgdir/$changelog")
fi
if [ -z "$wowi_archive" ]; then
Expand All @@ -2379,7 +2385,7 @@ if [ -z "$skip_zipfile" ]; then
case $result in
202)
echo "Success!"
rm -f "$wowi_changelog" 2>/dev/null
[ -f "$wowi_changelog" ] && rm -f "$wowi_changelog" 2>/dev/null
;;
401)
echo "Error! No addon for id \"$addonid\" found or you do not have permission to upload files."
Expand Down

0 comments on commit 3cbe458

Please sign in to comment.