build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# The pre-push hook: commits going to main must be signed as deploying it requires
|
|
|
|
|
# (tool/check_signatures.sh, a moment), then the checks CI runs (tool/check.dart,
|
2026-11-03 12:11:30 +01:00
|
|
|
# minutes), but for a push of release commits alone (below). A push only goes through
|
|
|
|
|
# when both pass.
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
#
|
|
|
|
|
# Install it in a fresh clone: ln -s ../../tool/pre-push .git/hooks/pre-push
|
|
|
|
|
# Skip it for one push: git push --no-verify
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
|
|
|
|
|
|
# As a hook in a worktree, git hands this its GIT_DIR, an absolute path to the worktree's
|
|
|
|
|
# folder in the main repository. pub runs git with -C on its git dependencies' caches, which
|
|
|
|
|
# GIT_DIR overrides, so it judged the workspace's resolution stale, resolved it with dart
|
|
|
|
|
# alone and failed ("halkyon_learn_flutter requires the Flutter SDK"; 2026-10-16). Nothing
|
|
|
|
|
# below needs them: git finds the repository from the folder it runs in.
|
|
|
|
|
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR GIT_OBJECT_DIRECTORY GIT_PREFIX
|
|
|
|
|
|
2026-11-03 12:11:30 +01:00
|
|
|
# git's arguments (the remote) and stdin (the refs pushed) go to the signature check, and
|
|
|
|
|
# to the question whether the push brings release commits alone: a release's version
|
|
|
|
|
# commit changes an app's version and its texts of what's new, nothing the checks look at,
|
|
|
|
|
# so it goes without them (tool/release_push.dart; decided 3 Nov 2026, so that releases in
|
|
|
|
|
# a row don't run the checks once each). Signed or not is checked all the same.
|
|
|
|
|
refs=$(cat)
|
|
|
|
|
printf '%s\n' "$refs" | tool/check_signatures.sh "$@"
|
|
|
|
|
if printf '%s\n' "$refs" | dart run tool/release_push.dart "$@"; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
exec dart run tool/check.dart
|