spiegel-keyman/developer/src/build.sh
Marc Durdin ba411774f6 maint(resources): move NPM package publishing to GitHub Actions
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.

Packages will be `npm pack`ed on PR and test builds, and published in
release builds.

Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/
Fixes: #14963
Test-bot: skip
Build-bot: release:developer
2025-10-27 16:31:55 +01:00

122 lines
4.7 KiB
Bash
Executable file

#!/usr/bin/env bash
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/builder-full.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE
. "$KEYMAN_ROOT/resources/build/utils.inc.sh"
builder_describe \
"Keyman Developer" \
"@/resources/tools/check-markdown test:help" \
clean \
configure \
build \
test \
"api Analyze API and prepare API documentation" \
"publish Prepare files for distribution, publish symbols, and build installer" \
"install Install built programs locally" \
":common Developer common files" \
":ext Third party components" \
":help Online documentation" \
":kmcmplib Compiler - .kmn compiler" \
":kmc-analyze Compiler - Analysis Tools" \
":kmc-copy Compiler - Project Copying and Renaming Tools" \
":kmc-generate Compiler - Generation Tools" \
":kmc-keyboard-info Compiler - .keyboard_info Module" \
":kmc-kmn Compiler - .kmn to .kmx and .js Keyboard Module" \
":kmc-ldml Compiler - LDML Keyboard Module" \
":kmc-model Compiler - Lexical Model Module" \
":kmc-model-info Compiler - .model_info Module" \
":kmc-package Compiler - Package Module" \
":kmc Compiler - Command Line Interface" \
":kmanalyze Legacy keyboard analysis tool" \
":kmdbrowserhost Keyman Developer Browser Host" \
":kmdecomp Unsupported decompiler" \
":kmconvert Legacy keyboard generation and conversion tool" \
":samples Sample projects" \
":server Keyman Developer Server" \
":setup Keyman Developer setup bootstrap" \
":test=test/auto Various older tests (others in each module)" \
":tike Keyman Developer IDE" \
":inst Bundled installers"
builder_describe_platform \
:ext win,delphi \
:kmanalyze win \
:kmdbrowserhost win,delphi \
:kmdecomp win \
:kmconvert win,delphi \
:samples win \
:server win \
:setup win,delphi \
:test win,delphi \
:tike win,delphi \
:inst win,delphi
# TODO: in future :server could be built on other platforms, potentially, but it
# has addons that are Windows-specific currently
builder_parse "$@"
#-------------------------------------------------------------------------------------------------------------------
if builder_is_windows; then
source "$KEYMAN_ROOT/resources/build/win/environment.inc.sh"
fi
#
# We want to do some checks before we head down the long publish path
#
function do_prepublish() {
builder_heading "prepublish - verify environment before build"
#
# Verify that the Delphi environment is correct for a release build
#
if [[ ! -f "$DEVTOOLS" ]]; then
# We'll build devtools here directly because we are before the configure /
# build steps which would trigger it in via dependencies
"$KEYMAN_ROOT"/common/windows/delphi/tools/devtools/build.sh configure build
fi
"$KEYMAN_ROOT"/common/windows/delphi/tools/devtools/build.sh prepublish
#
# Verify that klog is disabled
#
if [[ ! -f /common/windows/delphi/tools/test-klog/$WIN32_TARGET_PATH/test_klog.exe ]]; then
# We'll build test_klog here directly because we are before the configure /
# build steps which would trigger it in via dependencies
"$KEYMAN_ROOT"/common/windows/delphi/tools/test-klog/build.sh configure build
fi
"$KEYMAN_ROOT"/common/windows/delphi/tools/test-klog/build.sh prepublish
# All prepublish steps finished
}
if builder_has_action publish; then
do_prepublish
fi
#-------------------------------------------------------------------------------------------------------------------
builder_run_child_actions clean configure build test
builder_run_action test:help check-markdown "$KEYMAN_ROOT/developer/docs/help"
#-------------------------------------------------------------------------------------------------------------------
builder_run_child_actions api
builder_run_action api api-documenter markdown -i ../build/api -o ../build/docs
#-------------------------------------------------------------------------------------------------------------------
builder_run_child_actions publish
#-------------------------------------------------------------------------------------------------------------------
builder_run_child_actions install