Add artifact fetch build support#325
Conversation
- Upgrade ffigen dependency to ^20.0.0 in pubspec.yaml - Consolidate YAML ffigen configs into tool/ffigen.dart - Update tool/update-bindings.sh to run dart run tool/ffigen.dart - Re-generate native bindings
- Add hooks.user_defines.webcrypto.buildMode: fetch to pubspec.yaml - Support fetch, build, and local build modes in hook/build.dart - Add lib/src/hook_helpers/hashes.dart and tool/regenerate_hashes.dart for SHA256 integrity checks - Add .github/workflows/release-artifacts.yml matrix workflow supporting Linux, macOS, Windows, Android, and iOS - Pin workflow actions to full commit SHA hashes
|
Thanks for putting this together. ICU4X is a useful reference, and I like the checksum verification and the explicit build/local modes. I think we should choose the distribution model before getting too far into the implementation. #315 includes the CI-build binaries in the pub package, while this PR downloads only the required target binary from GitHub Releases. The fetch approach has a good size advantage once we add mobile targets and static archives. The packaged approach makes releases and offline builds simpler. I don’t think runtime fetching is necessarily a blocker, but we should agree on how assets and hashes are produced before publishing, what happens when GitHub cannot be reached, and whether release assets are treated as immutable. There are also a few implementation details to settle, including the current 0.6.1 versus v0.6.1 tag naming and validation of the Android and iOS outputs. I’d merge #324 separately so this PR stays focused on artifact delivery. @jonasfj, which direction do you think makes more sense for us long-term? It may also be worth comparing the actual total artifact size before choosing. |
Summary
hooks.user_defines.webcrypto.buildMode: fetchas the default build mode inpubspec.yaml.hook/build.dartto supportfetch(default),build(local CMake compilation), andlocal(custom local binary) modes.lib/src/hook_helpers/hashes.dart.tool/regenerate_hashes.dartto autogenerate release hash tables..github/workflows/release-artifacts.ymlcovering Linux, macOS (x64, arm64), Windows, Android (arm64, arm, x64), and iOS (arm64).workflow_dispatchfor workflow testing without publishing releases.After merging, we need to run the artifact generation once to get the hashes.