Commit graph

35 commits

Author SHA1 Message Date
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
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
8c28b96c9f chore(common): convert resources/build/version to ES Modules
Fixes #9677.
2023-10-04 12:21:35 +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
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
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
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
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
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
Marc Durdin
14d6cc0fab chore: add logging 2021-02-11 14:42:48 +11:00
Marc Durdin
daa07c1b99 chore: add timeout as well 2021-02-11 14:40:18 +11:00
Marc Durdin
9975e8a215 fix(common): create GitHub comments serially 2021-02-11 14:27:06 +11:00
Marc Durdin
6ec78ac4c1 feat(common): annotate PRs with build links
Fixes #4201.

This adds a comment to pull requests with information about which build
a particular PR will be landing in, based on the HISTORY.md we have
already updated.
2020-12-22 14:42:26 +11:00
Marc Durdin
bcb63ed232 fix(common): increment version needs to check base
The version history collector got confused because of commits
on two branches and needs to differentiate when asking for
the latest PR on a branch.
2020-12-16 06:19:56 +11:00
Marc Durdin
b888a6075b fix(common): improve increment-version robustness
Fixes #4061.

Four things:

1. Reorder the script steps so that builds are triggered before the PR
   is created. This should not really be necessary, but I am seeing some
   evidence that TeamCity is not respecting the commit sha we request to
   build. (This arose with 14.0.194 where a build agent became
   unavailable during a build and TC cancelled and restarted the build,
   but from a later revision... which this particular fix may not help,
   I guess...)
2. Add debug logging so we can see exactly which commit sha that we
   send to TeamCity
3. Handle errors in version increment by aborting the script with an
   error.
4. Add a -f force mode which we can use to trigger a build even if no
   changes are detected. This will need a corresponding patch in TC.
2020-12-03 10:24:19 +11:00
Marc Durdin
fb36fc3f69 chore(common): remove --first-parent when searching for PRs
Instead of just reporting on --first-parent, now lists all merges that
are in the log, which means we get some non-PR merges but that's ok. At
least we get all of them.

This was most visible with chained PRs which were merged bottom-up.
2020-11-26 09:49:21 +11:00
Marc Durdin
b4344da838 chore(ci): add bullets to history 2020-02-07 09:49:49 +11:00
Marc Durdin
fad3ff2822 chore(ci): add date to history headings 2020-02-04 06:53:30 +11:00
Marc Durdin
eff292c6b3 chore(ci): increment version final
This prepares a PR with updated history and version
for auto-merge. Any new PRs are merged into HISTORY.md
but existing entries are left untouched. Thus, we can
tweak wording in HISTORY.md at any time without the
effort of figuring out which PRs need to be present
manually.
2020-02-03 09:33:46 +11:00