chore(web): address code review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
Eberhard Beilharz 2026-08-31 19:02:05 +02:00
parent 20e651fd99
commit 7a0fa55a75
No known key found for this signature in database
GPG key ID: E9140597606020D3
2 changed files with 20 additions and 17 deletions

View file

@ -12,7 +12,7 @@
function isSentryConfigured() {
if [ -z "${SENTRY_AUTH_TOKEN-}" ] || [ -z "${SENTRY_ORG-}" ] || [ -z "${SENTRY_URL-}" ]; then
echo "WARNING: Sentry environment variables SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_URL must be configured."
builder_warn "WARNING: Sentry environment variables SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_URL must be configured."
return 1
fi
return 0
@ -20,7 +20,7 @@ function isSentryConfigured() {
function isSentryCliAvailable() {
which sentry-cli > /dev/null && return 0
echo "WARNING: sentry-cli could not be found. Skipping all sentry integration."
builder_warn "WARNING: sentry-cli could not be found. Skipping all sentry integration."
return 1
}
@ -28,29 +28,35 @@ function makeSentryRelease() {
if isSentryConfigured; then
if isSentryCliAvailable; then
# This version tag matches the repository version tag release@x.y.z
echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG"
builder_echo "Making a Sentry release for tag $KEYMAN_VERSION_GIT_TAG"
sentry-cli releases new -p keyman-android -p keyman-developer -p keyman-ios -p keyman-linux -p keyman-mac -p keyman-web -p keyman-windows $KEYMAN_VERSION_GIT_TAG
echo "Setting commits for release tag $KEYMAN_VERSION_GIT_TAG"
builder_echo "Setting commits for release tag $KEYMAN_VERSION_GIT_TAG"
sentry-cli releases set-commits --auto $KEYMAN_VERSION_GIT_TAG
echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG"
builder_echo "Finalizing release tag $KEYMAN_VERSION_GIT_TAG"
sentry-cli releases finalize "$KEYMAN_VERSION_GIT_TAG"
fi
fi
}
#
# Upload sourcemaps to Sentry
#
# Parameters:
# 1: Directory containing sourcemaps to upload
#
function sentry_upload_web () {
local SOURCEMAP_DIR="$1"
if ! isSentryConfigured; then
echo "Skipping Sentry upload: SENTRY_ORG and/or SENTRY_PROJECT are unset."
builder_warn "Skipping Sentry upload: SENTRY_ORG and/or SENTRY_PROJECT are unset."
return
fi
echo "Uploading $1 to Sentry..."
builder_echo "Uploading ${SOURCEMAP_DIR} to Sentry..."
# --strip-common-prefix does not take an argument, unlike --strip-prefix. It auto-detects
# the most common prefix instead.
sentry-cli releases files "${KEYMAN_VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix "$1" \
--rewrite --ext js --ext map --ext ts
echo "Upload successful."
sentry-cli releases files "${KEYMAN_VERSION_GIT_TAG}" upload-sourcemaps --strip-common-prefix \
"${SOURCEMAP_DIR}" --rewrite --ext js --ext map --ext ts
builder_echo "Upload successful."
}

View file

@ -3,21 +3,18 @@
ios_build() {
builder_echo start "build" "Building KeymanEngine + Keyman for iOS"
# shellcheck disable=SC2154
"${KEYMAN_ROOT}/ios/ci.sh" build
builder_launch /ios/ci.sh build
builder_echo end "build" success "Finished building KeymanEngine + Keyman for iOS"
}
ios_capture_build_artifacts() {
builder_echo start "prep-release" "Using prep-release script to capture build artifacts"
"${KEYMAN_ROOT}/ios/tools/prepRelease.sh"
builder_launch /ios/tools/prepRelease.sh
builder_echo end "prep-release" success "Finished capturing build artifacts"
}
ios_publish_symbols() {
builder_echo start "publish to Sentry" "Publishing source map to Sentry"
builder_launch /ios/build.sh "publish-symbols"
builder_echo end "publish to Sentry" success "Finished publishing source map to Sentry"
}