Originally Posted by CC_WOW
Can I just add the relevant parts to it without adding the "language: c" part, or must I add it for this script to work? Will it interfere with the execution if I do add it? Basically, I would want to combine the two to run the syntax check first and then deploy the file.
|
The only reason why "language: c" is chosen is because it's the fastest one that installs when Travis CI is setting up it's environment,
and the "default" language is (afaik) Ruby.
There is a "language: generic" that I'd prefer to use, but it's not documented so I'm staying away from using it.
You can add multiple scripts, but I'd recommend you use "after_script: " for the packager, to make sure that luacheck finishes first.
Originally Posted by CC_WOW
My tags are usually named rXX-(alpha|beta)?(-YY), such as r21-beta-3 or r25-alpha or simply r27/r27-2/etc. (a release version). This was mostly so that Curse can detect the alpha/beta/release state properly, as I'm using their API via GitHub webhooks.
The packager script apparently would consider all of them beta, and worse still, package untagged commits as alpha versions when they aren't ready for deployment at all. Now, I think the branches option would filter out the untagged commits, but how do I have the script package as alpha/beta/release correctly without forking/modifying it or changing my versioning scheme? Maybe Travis could detect them and rename it before calling the script?
|
Here's what the packager does to check what type of release your addon should be:
https://github.com/BigWigsMods/packa...sh#L1791-L1798
If the Git push was
not a tag, it'll default to
alpha.
If the Git push
was a tag, it'll check if the version matches "1.2.3" or "v1.2.3" or has the word "release" in it, if not it'll be flagged as beta.
So, without modifying the script, your normal pushes will always be alpha, and your "releases" will be beta.
I'd recommend you
fork the packager on GitHub, make the changes to match your versioning, then use that instead for the "after_script: ".
An alternative would be to apply a patch to the script before running it.
Something like this would do:
Code:
file_type=
if [ -n "$tag" ]; then
if [[ "${tag,,}" == *"alpha"* ]]; then
file_type=alpha
elif [[ "${tag,,}" == *"beta"* ]]; then
file_type=beta
else
file_type=release
fi
else
echo "Found no tag, exiting."
exit 0
fi
Then use the following regex for branch checking in .travis.yml:
^r\d+(-(alpha|beta))?(-\d+)?$