maint(resources): move build trigger scripts into resources/teamcity

This also removes the need to have a test for `-b` parameter in
trigger-test-builds.sh, because the TC scripts calling this can already
factor that in.

Testing script trigger so only do builds of common to verify

Fixes: #14483
Test-bot: skip
Build-bot: skip:all build:common
This commit is contained in:
Marc Durdin 2025-08-27 07:23:40 +02:00
parent 9ecbfe4fe7
commit 7390cc66aa
7 changed files with 52 additions and 58 deletions

View file

@ -1,10 +1,9 @@
#
# Automatically merges pull requests opened by keyman-server
# The initial use of this action is to increment the patch
# version of Keyman with resources/build/increment-version.sh.
# That script creates a PR and then this workflow will be
# triggered to approve the PR (from github-actions account), and
# then automerge it.
# Automatically merges pull requests opened by keyman-server The initial use of
# this action is to increment the patch version of Keyman with
# resources/teamcity/triggers/trigger-release-builds.sh. That script creates a PR and
# then this workflow will be triggered to approve the PR (from github-actions
# account), and then automerge it.
#
name: Auto Merge PRs from keyman-server
on:

View file

@ -35,10 +35,10 @@ and of course the source code for the packages:
- [.github/workflows/deb-packaging.yml](https://github.com/keymanapp/keyman/blob/master/.github/workflows/deb-packaging.yml)
contains the definition of the packaging GHA
- [resources/build/run-required-test-builds.sh](https://github.com/keymanapp/keyman/blob/master/resources/build/run-required-test-builds.sh)
- [resources/teamcity/triggers/trigger-test-builds.sh](https://github.com/keymanapp/keyman/blob/master/resources/teamcity/triggers/trigger-test-builds.sh)
runs on [TeamCity](https://build.palaso.org/buildConfiguration/Keyman_Test?)
to trigger the builds for the various platforms, among them the GHA package build.
- [resources/build/increment-version.sh](https://github.com/keymanapp/keyman/blob/master/resources/build/increment-version.sh)
- [resources/teamcity/triggers/trigger-release-builds.sh](https://github.com/keymanapp/keyman/blob/master/resources/teamcity/triggers/trigger-release-builds.sh)
runs on [TeamCity](https://build.palaso.org/buildConfiguration/Keyman_TriggerReleaseBuildsMaster?)
and increments the version number before triggering the builds for the
various platforms.

View file

@ -1,15 +1,3 @@
# Release builds
A release is triggered nightly whenever a pull request has been merged to the branch; it
runs from a TeamCity build configuration that runs `increment-version.sh` and then uploads
the resulting `HISTORY.md` to <https://downloads.keyman.com/history/HISTORY.md>.
To manually make a release (for example if a build falls over for a transient error or
there was a build configuration problem), create a new PR that targets the branch,
merge it, and then run the **Trigger Release Builds** build configuration for that
branch. If you have no changes, see that as an opportunity to improve documentation,
including this file...
## Various tools
### builder-basic.inc.sh, builder-full.inc.sh

View file

@ -1,10 +1,9 @@
# Version increment and automatic history maintenance
This node module automatically refreshes HISTORY.md with
titles from the latest pull requests merged since the last
automatic version increment, and if any history has been
found, increments the version, and creates a PR for the
This node module automatically refreshes HISTORY.md with titles from the latest
pull requests merged since the last automatic version increment, and if any
history has been found, increments the version, and creates a PR for the
increment.
It is wrappered by ../increment-version.sh for normal CI
It is wrappered by ../teamcity/triggers/trigger-release-builds.sh for normal CI
usage.

View file

@ -0,0 +1,18 @@
# Release builds
A release is triggered nightly whenever a pull request has been merged to the
master (alpha) or beta branches; it runs from a TeamCity build configuration
that runs `trigger-release-builds.sh` and then uploads the resulting
`HISTORY.md` to <https://downloads.keyman.com/history/HISTORY.md>.
For stable releases, these are always manually triggered in TeamCity.
To manually make a release (for example if a build falls over for a transient error or
there was a build configuration problem), create a new PR that targets the branch,
merge it, and then run the **Trigger Release Builds** build configuration for that
branch. If you have no changes, see that as an opportunity to improve documentation,
including this file...
# Test builds
Test builds are triggered for any commit to a PR, via `trigger-test-builds.sh`.

View file

@ -4,27 +4,27 @@ set -e
set -u
#
# Usage: increment-version.sh [-f] [commit base]
# Usage: trigger-release-builds.sh [-f] [commit base]
#
# Increments the patch version on VERSION.md
# Triggers release builds for the current version, increments the patch version
# on VERSION.md, writes version history to HISTORY.md, and creates an automerge
# PR with the version increment and history update.
#
# If -f is specified, triggers a build even with
# no detected changes.
# If -f is specified, triggers a build even with no detected changes.
#
# If commit is specified, pushes the new version
# to the repository. base snould be either
# master or beta.
# If commit is specified, pushes the new version to the repository. base snould
# be either master or beta.
#
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../resources/build/builder-basic.inc.sh"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder-basic.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE
. "${THIS_SCRIPT%/*}/ci/trigger-definitions.inc.sh"
. "${THIS_SCRIPT%/*}/ci/trigger-builds.inc.sh"
. "${THIS_SCRIPT%/*}/ci/sentry-control.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/trigger-definitions.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/trigger-builds.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/sentry-control.inc.sh"
gitbranch=`git branch --show-current`
@ -77,7 +77,7 @@ else
fi
if [[ $action == help ]]; then
echo "Usage: increment-version.sh [-f] [commit base]"
echo "Usage: trigger-release-builds.sh [-f] [commit base]"
echo " -f forces a build even with no changes"
echo " base must be either master, beta or stable-x.y."
echo " base must be equal to currently checked-out"
@ -87,20 +87,20 @@ fi
# Let's ensure our base is up to date with GitHub to
# avoid transient errors
echo "increment-version.sh: updating branch $base from GitHub"
echo "trigger-release-builds.sh: updating branch $base from GitHub"
git pull origin $base
#
# Run the increment + history refresh
#
echo "increment-version.sh: building resources/build/version"
echo "trigger-release-builds.sh: building resources/build/version"
pushd "$KEYMAN_ROOT"
npm ci
"$KEYMAN_ROOT/resources/build/version/build.sh"
echo "increment-version.sh: running resources/build/version"
echo "trigger-release-builds.sh: running resources/build/version"
pushd "$KEYMAN_ROOT"
ABORT=0
if [[ -z "$fromversion" ]]; then
@ -131,7 +131,7 @@ popd > /dev/null
#
if [ "$action" == "commit" ]; then
echo "increment-version.sh: committing to repository and tagging release version $KEYMAN_VERSION_WITH_TAG"
echo "trigger-release-builds.sh: committing to repository and tagging release version $KEYMAN_VERSION_WITH_TAG"
KEYMAN_VERSION_MD="$KEYMAN_ROOT/VERSION.md"
NEWVERSION=`cat $KEYMAN_VERSION_MD | tr -d "[:space:]"`

View file

@ -9,29 +9,19 @@
## 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"
. "${THIS_SCRIPT%/*}/../../../resources/build/builder-full.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE
. "${THIS_SCRIPT%/*}/ci/trigger-definitions.inc.sh"
. "${THIS_SCRIPT%/*}/ci/trigger-builds.inc.sh"
. "${THIS_SCRIPT%/*}/ci/trigger-build-bot.inc.sh"
. "${THIS_SCRIPT%/*}/jq.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/trigger-definitions.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/trigger-builds.inc.sh"
. "${KEYMAN_ROOT}/resources/build/ci/trigger-build-bot.inc.sh"
. "${KEYMAN_ROOT}/resources/build/jq.inc.sh"
builder_describe "Run test builds for the given pull request/primary branch" \
"--dry-run,-n Only report back which builds would be started" \
"--branch,-b=PRNUM Branch (master,beta,stable-x.y) or pull-request to test"
if [[ $# -eq 1 ]] && [[ "$1" =~ ^([0-9]+|master|beta|stable-[0-9]+\.[0-9]+)$ ]]; then
# For transitional period, when build configuration on TC needs to support
# both forms, we will pass a modified set of params to builder_parse
#
# TODO: remove this condition once all branches have received this change,
# and update TC build configuration to pass -b parameter
#
builder_parse -b "$1"
else
builder_parse "$@"
fi
builder_parse "$@"
# Validate parameters
@ -71,7 +61,7 @@ function triggerTestBuilds() {
if builder_has_option --dry-run; then
builder_echo "DRY RUN: cancel current builds for $branch"
else
node "$THIS_SCRIPT_PATH/ci/cancel-builds/cancel-test-builds.mjs" "$branch" "$TEAMCITY_TOKEN"
node "$KEYMAN_ROOT/resources/build/ci/cancel-builds/cancel-test-builds.mjs" "$branch" "$TEAMCITY_TOKEN"
fi
for platform in "${!platforms[@]}"; do