@@ -54,7 +54,8 @@ pkgmeta_file=
54
54
game_version=
55
55
game_type=
56
56
file_type=
57
- file_name=" {package-name}-{project-version}{nolib}{classic}"
57
+ file_template=" {package-name}-{project-version}{nolib}{classic}"
58
+ label_template=" {project-version}{classic}{nolib}"
58
59
59
60
wowi_markup=" bbcode"
60
61
@@ -150,7 +151,7 @@ usage() {
150
151
-a wago-id Set the project id used on Wago Addons for uploading. (Use 0 to unset the TOC value)
151
152
-g game-version Set the game version to use for uploading.
152
153
-m pkgmeta.yaml Set the pkgmeta file to use.
153
- -n package-name Set the package zip file name. Use "-n help" for more info.
154
+ -n "{template}" Set the package zip file name and upload label . Use "-n help" for more info.
154
155
EOF
155
156
}
156
157
@@ -234,28 +235,43 @@ while getopts ":celLzusop:dw:a:r:t:g:m:n:" opt; do
234
235
n) # Set the package file name
235
236
if [ " $OPTARG " = " help" ]; then
236
237
cat << -'EOF ' >&2
237
- Set the package zip file name. There are several string substitutions you can
238
- use to include version control and build type infomation in the file name.
238
+ Usage: release.sh [options]
239
+ Set the package zip file name and upload file label. There are several string
240
+ substitutions you can use to include version control and build type infomation in
241
+ the file name and upload label.
239
242
240
- The default file name is "{package-name}-{project-version}{nolib}{classic}".
243
+ The default file name is "{package-name}-{project-version}{nolib}{classic}".
244
+ The default upload label is "{project-version}{classic}{nolib}".
241
245
242
- Tokens: {package-name}{project-revision}{project-hash}{project-abbreviated-hash}
243
- {project-author}{project-date-iso}{project-date-integer}{project-timestamp}
244
- {project-version}{game-type}{release-type}
246
+ To set both, seperate with a ":", i.e, "{file template}:{label template}".
247
+ If either side of the ":" is blank, the default will be used.Not including a ":"
248
+ will set the file name template, leaving upload label as default.
245
249
246
- Flags: {alpha}{beta}{nolib}{classic}
250
+ Tokens: {package-name}{project-revision}{project-hash}{project-abbreviated-hash}
251
+ {project-author}{project-date-iso}{project-date-integer}{project-timestamp}
252
+ {project-version}{game-type}{release-type}
247
253
248
- Tokens are always replaced with their value. Flags are shown prefixed with a dash
249
- depending on the build type.
254
+ Flags: {alpha}{beta}{nolib}{classic}
255
+
256
+ Tokens are always replaced with their value. Flags are shown prefixed with a dash
257
+ depending on the build type.
250
258
EOF
251
259
exit 0
252
260
fi
253
- file_name=" $OPTARG "
254
- if skip_invalid=true filename_filter " $file_name " | grep -q ' [{}]' ; then
255
- tokens=$( skip_invalid=true filename_filter " $file_name " | sed -e ' /^[^{]*{\|}[^{]*{\|}[^{]*/s//}{/g' -e ' s/^}\({.*}\){$/\1/' )
261
+ if skip_invalid=true filename_filter " $OPTARG " | grep -q ' [{}]' ; then
262
+ tokens=$( skip_invalid=true filename_filter " $OPTARG " | sed -e ' /^[^{]*{\|}[^{]*{\|}[^{]*/s//}{/g' -e ' s/^}\({.*}\){$/\1/' )
256
263
echo " Invalid argument for option \" -n\" - Invalid substitutions: $tokens " >&2
257
264
exit 1
258
265
fi
266
+ file_template=${OPTARG%%:* }
267
+ if [ -z " $file_template " ]; then
268
+ file_template=" {package-name}-{project-version}{nolib}{classic}"
269
+ fi
270
+ label_template=${OPTARG##*: }
271
+ if [ -z " $label_template " ]; then
272
+ label_template=" {project-version}{classic}{nolib}"
273
+ fi
274
+ # "{package-name}-{project-version}{nolib}{classic}:{project-version}{classic}{nolib}"
259
275
;;
260
276
:)
261
277
echo " Option \" -$OPTARG \" requires an argument." >&2
@@ -2158,42 +2174,36 @@ fi
2158
2174
# ##
2159
2175
2160
2176
if [ -z " $skip_zipfile " ]; then
2161
- archive_version=" $project_version "
2162
- archive_name=" $( filename_filter " $file_name " ) .zip"
2163
- archive_label=" $archive_version "
2164
- if [[ " ${file_name} " == * " {game-type}" * ]] || [[ " $game_type " != " retail" && " ${file_name} " == * " {classic}" * ]]; then
2165
- # append the game-type for clarity
2166
- archive_label=" $archive_version -$game_type "
2167
- if [[ " $game_type " == " classic" && " ${project_version,,} " == * " -classic" * ]] || [[ " $game_type " == " bcc" && " ${project_version,,} " == * " -bcc" * ]]; then
2168
- # this is mostly for BigWigs projects that tag classic separately (eg, v10-classic)
2169
- # to prevent the extra -classic without changing all our workflows
2170
- archive_label=" $archive_version "
2171
- fi
2172
- fi
2177
+ archive_version=" $project_version " # XXX used for wowi version. should probably switch to label, but the game type gets added on by default :\
2178
+ archive_label=" $( filename_filter " $label_template " ) "
2179
+ archive_name=" $( filename_filter " $file_template " ) .zip"
2173
2180
archive=" $releasedir /$archive_name "
2174
2181
2175
- if [ -n " $GITHUB_ACTIONS " ]; then
2176
- echo " ::set-output name=archive_path::${archive} "
2177
- fi
2178
-
2179
2182
nolib_archive_version=" ${project_version} -nolib"
2180
- nolib_archive_name=" $( nolib=true filename_filter " $file_name " ) .zip"
2183
+ nolib_archive_label=" $( nolib=true filename_filter " $archive_label " ) "
2184
+ nolib_archive_name=" $( nolib=true filename_filter " $file_template " ) .zip"
2185
+ # someone didn't include {nolib} and they're forcing nolib creation
2186
+ if [ " $archive_label " = " $nolib_archive_label " ]; then
2187
+ nolib_archive_label=" ${nolib_archive_label} -nolib"
2188
+ fi
2181
2189
if [ " $archive_name " = " $nolib_archive_name " ]; then
2182
- # someone didn't include {nolib} and they're forcing nolib creation
2183
2190
nolib_archive_name=" ${nolib_archive_name# .zip} -nolib.zip"
2184
2191
fi
2185
- nolib_archive_label=" ${archive_label} -nolib"
2186
2192
nolib_archive=" $releasedir /$nolib_archive_name "
2187
2193
2188
2194
if [ -n " $nolib " ]; then
2189
2195
archive_version=" $nolib_archive_version "
2190
- archive_name=" $nolib_archive_name "
2191
2196
archive_label=" $nolib_archive_label "
2197
+ archive_name=" $nolib_archive_name "
2192
2198
archive=" $nolib_archive "
2193
2199
nolib_archive=
2194
2200
fi
2195
2201
2196
- start_group " Creating archive: $archive_name " " archive"
2202
+ if [ -n " $GITHUB_ACTIONS " ]; then
2203
+ echo " ::set-output name=archive_path::${archive} "
2204
+ fi
2205
+
2206
+ start_group " Creating archive: $archive_name ($archive_label )" " archive"
2197
2207
if [ -f " $archive " ]; then
2198
2208
rm -f " $archive "
2199
2209
fi
@@ -2218,7 +2228,7 @@ if [ -z "$skip_zipfile" ]; then
2218
2228
# make the exclude paths relative to the release directory
2219
2229
nolib_exclude=${nolib_exclude// $releasedir \/ / }
2220
2230
2221
- start_group " Creating no-lib archive: $nolib_archive_name " " archive.nolib"
2231
+ start_group " Creating no-lib archive: $nolib_archive_name ( $nolib_archive_label ) " " archive.nolib"
2222
2232
if [ -f " $nolib_archive " ]; then
2223
2233
rm -f " $nolib_archive "
2224
2234
fi
0 commit comments