Commit graph

63 commits

Author SHA1 Message Date
Marc Durdin
bfe3b77b81 maint: add script to report on recent changes to stable release
Build-bot: skip
Test-bot: skip
2025-12-23 12:30:53 +11:00
Marc Durdin
db3eef645e
Update resources/build/version/README.md
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-08-28 04:53:36 +02:00
Marc Durdin
7390cc66aa 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
2025-08-27 07:28:24 +02:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.

Fixes: #14447
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Marc Durdin
65158a0526 maint(common): rename shellHelperFunctions.sh to utils.inc.sh
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.

Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
2025-08-02 06:58:40 +10:00
Joshua Horton
08ba7c4208 maint: update @actions/github + @octokit references 2025-05-13 14:25:46 +07:00
Eberhard Beilharz
4d81589f48
maint(common): use unique names for Keyman version variables
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.

Test-bot: skip
2025-05-07 18:46:51 +02:00
Marc Durdin
cafa503124 chore: use explicit node: prefix on more module imports 2025-04-03 08:10:50 +07:00
Marc Durdin
b2fbfaf8cf fix: use tier and version from branch when merging history from another branch
Fixes: #13138
2025-02-10 15:45:34 +07:00
Marc Durdin
4bc3b78072 chore: use GitHub PR titles when writing HISTORY.md 2025-01-16 09:14:21 +07:00
dependabot[bot]
6fad148466
chore(deps): bump semver from 7.5.4 to 7.6.0
Bumps [semver](https://github.com/npm/node-semver) from 7.5.4 to 7.6.0.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.5.4...v7.6.0)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-14 11:22:58 +00:00
Joshua A. Horton
d07fa7e953 chore(common): eliminate ts-node ref from most subpackages 2024-06-10 10:07:58 +07:00
Joshua A. Horton
e527317d3a fix(common): remove subpackge entries for older TS version 2024-06-10 09:14:03 +07:00
Joshua A. Horton
01d0019d86 chore(web): removes package.json references to old @npm/types versions 2024-05-07 14:38:41 +07:00
Marc Durdin
cd8121ef65 chore(common): builder scripts now use /resources/build/builder.inc.sh
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).

This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
2024-05-02 15:54:31 +07:00
Marc Durdin
0f390d47cc chore(common): maintenance on build scripts - cd
Fixes #11324.

* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
2024-05-02 15:54:29 +07:00
Marc Durdin
db514e0dc5 fix(common): update emoji stripping for Unicode 15.1
Fixes #11220.

Replaces the sed script for matching emoji in ios prepRelease with a
tiny node project that uses emoji-regex package, to reduce future
maintenance.

Also strips lingering emoji and :xxx: emoji shortcut strings from
HISTORY.md. Note that :xxx: are not stripped programatically at this
time.
2024-04-18 09:05:30 +07:00
Marc Durdin
fdc2cd438e chore: workaround release inc build block
Fixes #10721.

This arose partly because of the change from release- to release@ in at
17.0.30-alpha (triggered by sentry req). Will require a corresponding
patch to CI script to pass the --from and --to parameters.
2024-02-15 12:51:02 +07:00
Marc Durdin
4f44ac6e2a fix: path for ESM increment-version, and exit code
* Fixes the path for the increment-version module
* Uses exit code 50 instead of 1 to indicate 'success, but no change',
  so that low-value error exit codes as used by node.js don't
  indavertently continue the build
2023-10-11 09:39:03 +07:00
Marc Durdin
d4e4992714 chore(common): cleanup final Typescript non-ESM metadata
Fixes #9262.
2023-10-04 12:55:51 +07:00
Marc Durdin
fbd9a4b5e8 chore(common): convert resources/build/version to ES Modules
Fixes #9677.
2023-10-04 11:50:53 +07:00
dependabot[bot]
7d08b08fb2
chore(deps): bump semver from 7.3.8 to 7.5.2
Bumps [semver](https://github.com/npm/node-semver) from 7.3.8 to 7.5.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.8...v7.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-24 12:37:06 +00:00
Joshua A. Horton
a3752dd9ff chore(common): full-repo ts-node update 2023-02-09 12:39:15 +07:00
Joshua A. Horton
878e0f0ea2 chore(common): updates typescript to 4.9.5 2023-02-09 08:40:52 +07:00
Marc Durdin
067028cec2 chore: revise tag variable name to VERSION_GIT_TAG
Introduce new $VERSION_GIT_TAG environment variable, and update all
references to release@version in all projects to use the new variable.
2023-01-21 17:02:50 +07:00
Marc Durdin
ec12469487
Merge pull request #7776 from keymanapp/chore/cleanup-history
chore: cleanup history
2022-11-21 17:20:45 +11:00
Marc Durdin
de0179ca39 fix: automatically merge changes to history back to master
Fixes #7351.
2022-11-21 10:20:22 +11:00
Marc Durdin
4355a9ff1c chore: use local history instead of PR title 2022-11-21 09:48:56 +11:00
Marc Durdin
9168d896e7 chore(common): remove unused ncc dependency
The `build:dist` script was never used; increment-version.sh uses only
`build:ts`.
2022-09-19 14:47:37 +10:00
dependabot[bot]
ea50559fc1
chore(deps): bump @actions/core from 1.8.2 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.8.2 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-18 19:58:19 +00:00
Marc Durdin
9147bf3a48 chore: fix version increment for force parameter 2022-06-15 14:55:45 +10:00
Marc Durdin
a9c5b4ecb7 fix(common): update increment-version for new tsc, node versions
* Addresses some Typescript-specific breaking changes in destructured
  types.
* Removes npm version calls and package*.json updates -- these are no
  longer required.
* Adds resources/build/version as a workspace to root package.json.
* Runs `npm ci` on the repo root for resources/build/version.
* Adds additional logging.
2022-06-13 15:54:18 +10:00
Marc Durdin
fcf78bcd94 chore: merge master into branch 2022-05-27 13:11:23 +10:00
Marc Durdin
d8f81cbdf1 chore(common): improve PR reporting of changes
Fixes #6391.

The issue here was quite nuanced: where we merged a PR, and then merged
the changes into an earlier PR, but left it open, the earlier PR could
end up getting the release information comment from keyman-server
instead of the later, merged PR. This was because the commit would
appear in both PRs, so GitHub would report on both of them.

This is not a 100% fix -- but it should stop the PR tagging on unmerged
pull requests. The one situation where this may leave a gap is where we
have multiple PRs merged on the same day, where a later PR's changes are
merged into an earlier PR; in this case I think it is possible that one
of the PRs will not get the informative version comment.

But given the current fix should avoid the more common situation, I am
comfortable to leave it as is for now. This is only informative data...
and a more complete fix is a distraction.
2022-05-17 10:43:07 +10:00
Marc Durdin
0fbf53f8d7 chore(web): move version from package.json to keyman-version package
Starts to resolve the chaos of putting version numbers into every
package.json file.

Adds a new keyman-version package which mimics the
version information in build-utils.sh. This will eventually replace
resources/web-environment.

Fixes the build for the lexical model compiler tools to remove refs to
package.json version and use keyman-version instead.

More fixes coming in a follow-up.
2022-04-17 06:47:39 +10:00
Marc Durdin
4d94786852 chore(web): replace lerna with npm workspaces and ts projects
Fixes #6320.

Part 1 of moving from lerna to a simpler, maintained monorepo solution,
using TypeScript Projects and NPM Workspaces.

There is more work to be done here. At this point, KeymanWeb builds and
runs without errors, but the built file is substantially different,
mostly in include order.

Using TypeScript Projects, we move away from the need to run build
scripts in various locations for almost all the Typescript modules.

TODO: Embedded versions and tests have not been verified.

TODO: developer/server is not yet verified.

TODO: developer/js (needs a rename!) is not yet verified.

TODO: Currently, the predictive-text folder needs refactoring to move
the construction of the worker wrapper out of the Predictive Text build
and into the final assembly of keymanweb.js (as it should be valid to
run it as a separate .js anyway).

TODO: Most of the `<reference>` paths need to be re-verified. Ideally
there should be no references outside the current module for any given
.ts.

TODO: The embedded vs browser vs node (headless) builds should be tidied
up for consistency so that it's obvious what depends on what. This is
currently messiest in the predictive-text folder, where the output names
diverge from the filenames and the various files are mixed in the same
folder (as evidenced by the exclusions listed in each tsconfig.json).

TODO: `npm install` should be removed from most build scripts and
instead `npm ci` (#6196) should be run only once from the top-level
folder for any given build. I've had eliminated side-effects from the
`install` action for npm, which makes it easier to reason about state.

TODO: verify_npm_setup and related functions can probably be eliminated.

TODO: most of the build scripts should be largely eliminated for web.

TODO: several ts projects use inconsistent output folders.

TODO: it may be possible to generate a .d.ts for models/types so that
we can use a consistent reference for those as well.

TODO: build.sh, tsconfig.json should always be in the module's top-level
folder, not in a subfolder such as src (e.g. see input-processor/src,
keyboard-processor/src, web/source).

TODO: resources/web-environment should be in common/web.

TODO: other js node_modules imports should be wrapped like es6-shim.

TODO: fix up the publish code for npm modules

TODO: eliminate version numbers from package.json if possible?

Whew, that's most of the stuff I noticed!
2022-04-12 21:02:33 +10:00
Marc Durdin
3eceea8735 fix(common): report more log detail in increment-version
Relates to #6391.

Adds some logging so we may be able to find out why we are getting
strange results for some PRs.
2022-03-24 08:52:10 +11:00
dependabot[bot]
c9bc409b42
chore(deps): bump node-fetch in /resources/build/version
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 05:25:46 +00:00
dependabot[bot]
a7f17946be
chore(deps): bump ansi-regex in /resources/build/version
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 18:02:36 +00:00
Marc Durdin
92336aaa19 chore: fix git date param 2021-08-19 16:52:52 +10:00
Marc Durdin
2b367cf496 chore(common): more on report-history
* Adds support for reporting historical release ranges (--from, --to)
* Filters emoji out of titles
* Uses HISTORY.md formatting for report-history
2021-08-19 16:49:47 +10:00
Marc Durdin
85c3a424a7 chore(common): history reporting fixes
1. Adds parsing of commit comments to extract PR title + number.
2. Uses `--first-parent` to exclude merges that are not to the
   base branch. This means that if you merge a PR into another, that
   child PR will not be listed in the history. From my perspective, this
   is fine -- we prefer chained PRs to be merged bottom-up rather than
   top-down, and this allows for PRs to be collapsed into one history
   entry if we really want that anyway.
3. Cleans up the git log range to work correctly regardless of your
   current branch.
4. Reads git log information from origin/base rather than base.

Note: this assumes that you have recently `git fetch origin` (or
`git pull origin`); that's up to you.
2021-08-19 11:16:13 +10:00
Marc Durdin
ff8ac35106 chore(common): add report-history.sh
Relates to #5172.

Adds a report-history.sh script to help report on what changes will be
in the upcoming build. Uses the same strategy as we currently use to
grab pull request numbers for HISTORY.md.

Also fixes duplicate entries that sometimes appear in HISTORY.md due to
merges from master into PR branches.
2021-07-30 17:35:04 +10:00
Marc Durdin
7ef751fe20 chore(common): report-history mode for version.js
Adds a report-history mode for version.js so we can examine the list of
changes that will be in the next release build for a release branch
(master, beta, stable-x.y).

How to run:

    pushd resources/build/version
    npm install
    npm run build:ts
    popd
    node resources/build/version/lib/index.js report-history -t "$GITHUB_TOKEN" -b "$base"

* Note: Always run from repo root.
* Where $GITHUB_TOKEN is a personal access token
* Where $base, if specified is the branch to validate (default: master)
2021-07-29 16:46:04 +10:00
jahorton
68f817a2af fix(common): resource-build-version yargs audit 2021-07-02 15:30:41 +07:00
dependabot[bot]
b537c759f9
chore(deps): bump y18n from 4.0.0 to 4.0.1 in /resources/build/version
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 23:59:19 +00:00
Marc Durdin
000867e89b chore(common): allow forced version increment
Allows us to manually run a version increment, for example if there is
a problem with a release build such as running out of space on the
download server.
2021-02-25 06:28:32 +11:00
Marc Durdin
42511c442e chore: whitespace 2021-02-12 15:44:07 +11:00
Marc Durdin
09ace08f7e fix(windows): tsysinfox64 not signed
Fixes #4484.

tsysinfox64 was being signed, but too late in the build
process as it is embedded into tsysinfo.exe. There was
code to sign it earlier, but that was being skipped due
to a missing build flag. This has been a problem for
some time.
2021-02-12 14:20:41 +11:00