Skip to content

Commit 253fc08

Browse files
ctruedenclaude
andcommitted
ci-build.sh: release modules of multi-module repositories
When one module of a multi-module repository is released, its release.properties file lives in the module's directory rather than the repository root. So we now detect that situation, and perform the deployment checks and release from that directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6c39952 commit 253fc08

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

‎ci-build.sh‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# BUILD_REPOSITORY - the repository URL running the current build
99

1010
dir="$(dirname "$0")"
11+
rootDir="$(pwd)"
1112

1213
platform=$(uname -s)
1314

@@ -86,7 +87,7 @@ dump() {
8687
}
8788

8889
analyzeGitHubWorkflow() {
89-
test -d .github/workflows || return
90+
test -d "$rootDir/.github/workflows" || return
9091
echo
9192
echo '/--------------------------------------------------\'
9293
echo '| ci-build.sh analysis: env vars + GitHub workflow |'
@@ -113,7 +114,7 @@ analyzeGitHubWorkflow() {
113114
CENTRAL_PASS \
114115
SIGNING_ASC
115116
do
116-
grep -q "secrets.$var" .github/workflows/*.yml ||
117+
grep -q "secrets.$var" "$rootDir"/.github/workflows/*.yml ||
117118
echo "Add \`$var: \${{ secrets.$var }}\` to GitHub workflow env section!"
118119
done
119120
}
@@ -207,6 +208,25 @@ EOL
207208
EOL
208209
fi
209210

211+
# --== MULTI-MODULE RELEASE DETECTION ==--
212+
213+
# When one module of a multi-module repository is released, its
214+
# release.properties file lives in the module's directory, from
215+
# which the release must then be checked and performed.
216+
if [ ! -f release.properties ]; then
217+
moduleReleaseFiles=$(git ls-files '*/release.properties' 2>/dev/null)
218+
moduleReleaseCount=$(printf '%s' "$moduleReleaseFiles" | grep -c .)
219+
if [ "$moduleReleaseCount" -gt 1 ]; then
220+
echo '[ERROR] Multiple release.properties files are present:'
221+
echo "$moduleReleaseFiles"
222+
exit 1
223+
elif [ "$moduleReleaseCount" -eq 1 ]; then
224+
moduleDir=$(dirname "$moduleReleaseFiles")
225+
echo "Detected release of module: $moduleDir"
226+
cd "$moduleDir" || exit 1
227+
fi
228+
fi
229+
210230
# --== DEPLOYMENT CHECKS ==--
211231

212232
# Determine whether deploying is both possible and warranted.

0 commit comments

Comments
 (0)