Skip to content

Commit 1004c31

Browse files
authored
Add 3.4.0 Support (#123)
1 parent 41b0cab commit 1004c31

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

release.sh

+33-12
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VER
7474
fi
7575

7676
# Game versions for uploading
77-
declare -A game_flavor=( ["retail"]="retail" ["classic"]="classic" ["bcc"]="bcc" ["mainline"]="retail" ["tbc"]="bcc" ["vanilla"]="classic" )
77+
declare -A game_flavor=( ["retail"]="retail" ["classic"]="classic" ["bcc"]="bcc" ["mainline"]="retail" ["tbc"]="bcc" ["vanilla"]="classic" ["wrath"]="wrath" ["wotlkc"]="wrath" )
7878

7979
declare -A game_type_version=() # type -> version
8080
declare -A game_type_interface=() # type -> toc
@@ -116,7 +116,8 @@ filename_filter() {
116116
[ -n "$skip_invalid" ] && invalid="&"
117117
if [[ -n $game_type ]] && [[ "$game_type" != "retail" ]] && \
118118
[[ "$game_type" != "classic" || "${si_project_version,,}" != *"-classic"* ]] &&\
119-
[[ "$game_type" != "bcc" || "${si_project_version,,}" != *"-bcc"* ]]
119+
[[ "$game_type" != "bcc" || "${si_project_version,,}" != *"-bcc"* ]] &&\
120+
[[ "$game_type" != "wrath" || "${si_project_version,,}" != *"-wrath"* ]]
120121
then
121122
# only append the game type if the tag doesn't include it
122123
classic="-$game_type"
@@ -217,7 +218,7 @@ while getopts ":celLzusSop:dw:a:r:t:g:m:n:" opt; do
217218
g) # Set the game type or version
218219
OPTARG="${OPTARG,,}"
219220
case "$OPTARG" in
220-
retail|classic|bcc) game_type="$OPTARG" ;; # game_version from toc
221+
retail|classic|bcc|wrath) game_type="$OPTARG" ;; # game_version from toc
221222
mainline) game_type="retail" ;;
222223
*)
223224
# Set game version (x.y.z)
@@ -233,6 +234,8 @@ while getopts ":celLzusSop:dw:a:r:t:g:m:n:" opt; do
233234
game_type="classic"
234235
elif [[ ${BASH_REMATCH[1]} == "2" ]]; then
235236
game_type="bcc"
237+
elif [[ ${BASH_REMATCH[1]} == "3" ]]; then
238+
game_type="wrath"
236239
else
237240
game_type="retail"
238241
fi
@@ -1064,6 +1067,7 @@ do_toc() {
10641067
"") toc_game_type= ;;
10651068
11*) toc_game_type="classic" ;;
10661069
20*) toc_game_type="bcc" ;;
1070+
30*) toc_game_type="wrath" ;;
10671071
*) toc_game_type="retail"
10681072
esac
10691073
si_game_type_interface=()
@@ -1072,7 +1076,7 @@ do_toc() {
10721076

10731077
root_toc_version="$toc_version"
10741078

1075-
if [[ ${toc_name} =~ "$package_name"[-_](Mainline|Classic|Vanilla|BCC|TBC)\.toc$ ]]; then
1079+
if [[ ${toc_name} =~ "$package_name"[-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC)\.toc$ ]]; then
10761080
# Flavored
10771081
if [[ -z "$toc_version" ]]; then
10781082
echo "$toc_name is missing an interface version." >&2
@@ -1103,6 +1107,7 @@ do_toc() {
11031107
case $toc_version in
11041108
11*) toc_game_type="classic" ;;
11051109
20*) toc_game_type="bcc" ;;
1110+
30*) toc_game_type="wrath" ;;
11061111
*) toc_game_type="retail"
11071112
esac
11081113
fi
@@ -1113,6 +1118,7 @@ do_toc() {
11131118
case $toc_game_type in
11141119
classic) toc_version=$( sed -n '/@non-[-a-z]*@/,/@end-non-[-a-z]*@/{//b;p}' <<< "$toc_file" | awk '/#[[:blank:]]*## Interface:[[:blank:]]*(11)/ { print $NF; exit }' ) ;;
11151120
bcc) toc_version=$( sed -n '/@non-[-a-z]*@/,/@end-non-[-a-z]*@/{//b;p}' <<< "$toc_file" | awk '/#[[:blank:]]*## Interface:[[:blank:]]*(20)/ { print $NF; exit }' ) ;;
1121+
wrath) toc_version=$( sed -n '/@non-[-a-z]*@/,/@end-non-[-a-z]*@/{//b;p}' <<< "$toc_file" | awk '/#[[:blank:]]*## Interface:[[:blank:]]*(30)/ { print $NF; exit }' ) ;;
11161122
esac
11171123
# This becomes the actual interface version after replacements
11181124
root_toc_version="$toc_version"
@@ -1172,6 +1178,7 @@ set_build_version() {
11721178
case $toc_version in
11731179
11*) toc_game_type="classic" ;;
11741180
20*) toc_game_type="bcc" ;;
1181+
30*) toc_game_type="wrath" ;;
11751182
*) toc_game_type="retail"
11761183
esac
11771184
if [[ -z $game_type || $game_type == "$toc_game_type" ]]; then
@@ -1203,14 +1210,14 @@ if [[ -z "$package" ]]; then
12031210
exit 1
12041211
fi
12051212
package=${package%.toc}
1206-
if [[ $package =~ ^(.*)([-_](Mainline|Classic|Vanilla|BCC|TBC))$ ]]; then
1213+
if [[ $package =~ ^(.*)([-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC))$ ]]; then
12071214
echo "Ambiguous addon name. No fallback TOC file or addon name includes an expansion suffix (${BASH_REMATCH[2]}). Set 'package-as' in .pkgmeta" >&2
12081215
exit 1
12091216
fi
12101217
fi
12111218

12121219
# Parse the project root TOC files for info first
1213-
for toc_path in "$topdir/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC}.toc; do
1220+
for toc_path in "$topdir/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC}.toc; do
12141221
if [[ -f "$toc_path" ]]; then
12151222
set_toc_project_info "$toc_path"
12161223
toc_root_paths["$topdir"]="$package"
@@ -1226,7 +1233,7 @@ done
12261233

12271234
# Parse project TOC files
12281235
for path in "${!toc_root_paths[@]}"; do
1229-
for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC}.toc; do
1236+
for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC}.toc; do
12301237
if [[ -f "$toc_path" ]]; then
12311238
set_toc_project_info "$toc_path"
12321239
do_toc "$toc_path" "${toc_root_paths[$path]}"
@@ -1683,6 +1690,7 @@ copy_directory_tree() {
16831690
[ "$_cdt_gametype" != "retail" ] && _cdt_filters+="|lua_filter version-retail|lua_filter retail"
16841691
[ "$_cdt_gametype" != "classic" ] && _cdt_filters+="|lua_filter version-classic"
16851692
[ "$_cdt_gametype" != "bcc" ] && _cdt_filters+="|lua_filter version-bcc"
1693+
[ "$_cdt_gametype" != "wrath" ] && _cdt_filters+="|lua_filter version-wrath"
16861694
[ -n "$_cdt_localization" ] && _cdt_filters+="|localization_filter"
16871695
;;
16881696
*.xml)
@@ -1693,6 +1701,7 @@ copy_directory_tree() {
16931701
[ "$_cdt_gametype" != "retail" ] && _cdt_filters+="|xml_filter version-retail|xml_filter retail"
16941702
[ "$_cdt_gametype" != "classic" ] && _cdt_filters+="|xml_filter version-classic"
16951703
[ "$_cdt_gametype" != "bcc" ] && _cdt_filters+="|xml_filter version-bcc"
1704+
[ "$_cdt_gametype" != "wrath" ] && _cdt_filters+="|xml_filter version-wrath"
16961705
;;
16971706
*.toc)
16981707
# We only care about processing project TOC files
@@ -1704,6 +1713,7 @@ copy_directory_tree() {
17041713
case ${toc_root_interface["$_cdt_srcdir/$file"]} in
17051714
11*) _cdt_gametype="classic" ;;
17061715
20*) _cdt_gametype="bcc" ;;
1716+
30*) _cdt_gametype="wrath" ;;
17071717
*) _cdt_gametype="retail"
17081718
esac
17091719
fi
@@ -1715,6 +1725,7 @@ copy_directory_tree() {
17151725
_cdt_filters+="|toc_filter version-retail $([[ "$_cdt_gametype" != "retail" ]] && echo "true")"
17161726
_cdt_filters+="|toc_filter version-classic $([[ "$_cdt_gametype" != "classic" ]] && echo "true")"
17171727
_cdt_filters+="|toc_filter version-bcc $([[ "$_cdt_gametype" != "bcc" ]] && echo "true")"
1728+
_cdt_filters+="|toc_filter version-wrath $([[ "$_cdt_gametype" != "wrath" ]] && echo "true")"
17181729
_cdt_filters+="|toc_interface_filter '${si_game_type_interface_all[${_cdt_gametype:- }]}' '${toc_root_interface["$_cdt_srcdir/$file"]}'"
17191730
[ -n "$_cdt_localization" ] && _cdt_filters+="|localization_filter"
17201731
fi
@@ -1730,10 +1741,10 @@ copy_directory_tree() {
17301741
echo " Copying: $file"
17311742

17321743
# Make sure we're not causing any surprises
1733-
if [[ -z $_cdt_gametype && ( $file == *".lua" || $file == *".xml" || $file == *".toc" ) ]] && grep -q '@\(non-\)\?version-\(retail\|classic\|bcc\)@' "$_cdt_srcdir/$file"; then
1744+
if [[ -z $_cdt_gametype && ( $file == *".lua" || $file == *".xml" || $file == *".toc" ) ]] && grep -q '@\(non-\)\?version-\(retail\|classic\|bcc\|wrath\)@' "$_cdt_srcdir/$file"; then
17341745
echo " Error! Build type version keywords are not allowed in a multi-version build." >&2
17351746
echo " These should be replaced with lua conditional statements:" >&2
1736-
grep -n '@\(non-\)\?version-\(retail\|classic\|bcc\)@' "$_cdt_srcdir/$file" | sed 's/^/ /' >&2
1747+
grep -n '@\(non-\)\?version-\(retail\|classic\|bcc\|wrath\)@' "$_cdt_srcdir/$file" | sed 's/^/ /' >&2
17371748
echo " See https://wowpedia.fandom.com/wiki/WOW_PROJECT_ID" >&2
17381749
exit 1
17391750
fi
@@ -1751,6 +1762,7 @@ copy_directory_tree() {
17511762
retail) new_file+="_Mainline.toc" ;;
17521763
classic) new_file+="_Vanilla.toc" ;;
17531764
bcc) new_file+="_TBC.toc" ;;
1765+
wrath) new_file+="_Wrath.toc" ;;
17541766
esac
17551767

17561768
echo " Creating $new_file [$toc_version]"
@@ -1764,6 +1776,7 @@ copy_directory_tree() {
17641776
_cdt_filters+="|toc_filter version-retail $([[ "$type" != "retail" ]] && echo "true")"
17651777
_cdt_filters+="|toc_filter version-classic $([[ "$type" != "classic" ]] && echo "true")"
17661778
_cdt_filters+="|toc_filter version-bcc $([[ "$type" != "bcc" ]] && echo "true")"
1779+
_cdt_filters+="|toc_filter version-wrath $([[ "$type" != "wrath" ]] && echo "true")"
17671780
_cdt_filters+="|toc_interface_filter '$toc_version' '$root_toc_version'"
17681781
_cdt_filters+="|line_ending_filter"
17691782

@@ -2506,12 +2519,13 @@ upload_curseforge() {
25062519
_cf_game_version_id=
25072520
_cf_game_version=
25082521
local version_name version_id game_id
2509-
for type in "classic" "bcc" "retail"; do # sort order (last id is show as the version on the project's files page apparently)
2522+
for type in "classic" "bcc" "wrath" "retail"; do # sort order (last id is show as the version on the project's files page apparently)
25102523
version_name="${game_type_version[$type]}"
25112524
[[ -z $version_name ]] && continue
25122525
case $type in
25132526
classic) game_id=67408 ;;
25142527
bcc) game_id=73246 ;;
2528+
wrath) game_id=73713 ;;
25152529
*) game_id=517
25162530
esac
25172531

@@ -2619,6 +2633,10 @@ upload_wowinterface() {
26192633
version="${game_type_version[$type]}"
26202634
# check the version
26212635
if ! jq -e --arg v "$version" 'map(select(.id == $v)) | length > 0' <<< "$_wowi_versions" &>/dev/null; then
2636+
if [[ $type == "wrath" ]]; then # XXX compat
2637+
echo "WARNING: Wrath is currently unsupported by WoWInterface, falling back to BCC" >&2
2638+
version="2.5.10"
2639+
fi
26222640
# split out the versions that match the version we're checking against (to keep things more readable)
26232641
_wowi_versions_type=$( echo "$_wowi_versions" | jq -c --arg v "$version" 'map(select( (.id | .[:2]) == ($v | .[:2]) ))' )
26242642
if [[ $_wowi_versions_type == "[]" ]]; then
@@ -2722,8 +2740,11 @@ upload_wago() {
27222740
local version wago_type
27232741
for type in "${!game_type_version[@]}"; do
27242742
version="${game_type_version[$type]}"
2725-
wago_type="$type"
2726-
[[ "$wago_type" == "bcc" ]] && wago_type="bc"
2743+
case $type in
2744+
bcc) wago_type="bc" ;;
2745+
wrath) wago_type="wotlk" ;;
2746+
*) wago_type="$type"
2747+
esac
27272748
# check the version
27282749
if ! jq -e --arg t "$wago_type" --arg v "$version" '.[$t] | index($v)' <<< "$_wago_versions" &>/dev/null; then
27292750
# no match, so grab the next highest version (try to avoid testing versions)

0 commit comments

Comments
 (0)