Skip to content

Commit

Permalink
Support new bundle name in the build server script
Browse files Browse the repository at this point in the history
This fix makes sure that both `*.play.aab` and `*.aab`
bundles are supported and get the correct names.

Ideally the `sed` command which this commit touches
would be able to add the suffix using a small tweak
to the pattern like this:
`(MullvadVPN-.*-dev-.*)(\.apk|\.play\.aab|\.aab)`

However, that pattern would result in the suffix
being incorrectly placed due the greedy nature
of `sed` like the "incorrect" one below:
MullvadVPN-<version>.play+suffix.aab (incorrect)
MullvadVPN-<version>+suffix.play.aab (correct)
  • Loading branch information
albin-mullvad committed Sep 21, 2023
1 parent 394fef9 commit 62d94a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ci/buildserver-build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ function build_ref {
# Pipes all matching names and their new name to mv
pushd "$artifact_dir"
for original_file in MullvadVPN-*-dev-*{.apk,.aab}; do
new_file=$(echo "$original_file" | sed -nE "s/^(MullvadVPN-.*-dev-.*)(\.apk|\.aab)$/\1$version_suffix\2/p")
# Fix to make sure the sed command below result in the expected file name.
if [[ $original_file == *.play.aab ]]; then
bundle_extension="\.play\.aab"
else
bundle_extension="\.aab"
fi
new_file=$(echo "$original_file" | sed -nE "s/^(MullvadVPN-.*-dev-.*)(\.apk|$bundle_extension)$/\1$version_suffix\2/p")
mv "$original_file" "$new_file"
done
popd
Expand Down

0 comments on commit 62d94a2

Please sign in to comment.