This document describes the continuous integration and deployment setup for the Zstandard plugin and CLI, including GitHub Actions workflows and how to use them.
The repository uses GitHub Actions for:
- PR checks: Analyze and test each package on pull requests (open or new commits; except to protected branches).
- Release workflow: Version bumping, building precompiled CLI libraries, tagging, and publishing to pub.dev.
- Hotfix workflow: Expedited fixes and releases when needed.
Workflows are in .github/workflows/.
Each package has a dedicated workflow that runs on pull requests (open or new commits to the PR branch) to non-protected branches:
| Workflow file | Package | Runner | Steps |
|---|---|---|---|
pr_check_zstandard.yml |
zstandard | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_android.yml |
zstandard_android | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_ios.yml |
zstandard_ios | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_macos.yml |
zstandard_macos | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_linux.yml |
zstandard_linux | self-hosted Linux | Analyze, Test (with coverage), Publish dry run |
pr_check_windows.yml |
zstandard_windows | self-hosted Windows | Analyze, Test (with coverage), Publish dry run |
pr_check_web.yml |
zstandard_web | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_cli.yml |
zstandard_cli | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
pr_check_platform_interface.yml |
zstandard_platform_interface | self-hosted macOS | Analyze, Test (with coverage), Publish dry run |
There is no dedicated PR check workflow for zstandard_native (it has no Dart tests; it mainly ships C source and bindings). It is published in the release workflow after platform_interface and before the platform packages that depend on it.
Branches excluded from running these checks: develop, release/**, hotfix/**, master.
Concurrency: Only the latest run per branch/PR is kept; in-progress runs are cancelled when new commits are pushed to the PR.
- Flutter packages:
flutter test --coverageproducescoverage/lcov.infoin the package directory. - CLI package:
dart test --coverage=coveragethendart run coverage:format_coverageto produce lcov. - Coverage is uploaded to Codecov (or similar) via the
codecov/codecov-action@v4step when the workflow runs. Upload failure does not fail the job (fail_ci_if_error: false).
File: .github/workflows/release_workflow.yml
Triggered manually (workflow_dispatch) with inputs such as version, title, changelog, and optional issue reference.
Main phases:
- Update files: Bump version and dependency versions in all packages; copy CHANGELOG; commit.
- Build precompiled CLI libraries (on platform-specific runners):
- macOS: Clone facebook/zstd, build Intel and ARM64 libs, merge with
lipointo a universallibzstandard_macos.dylib; commit. - Linux: Clone zstd, build x64 and ARM64
.so; commit. - Windows: Clone zstd, build x64 and ARM64 DLLs; commit.
- macOS: Clone facebook/zstd, build Intel and ARM64 libs, merge with
- Tag and release: Create git tag (e.g.
v1.5.0) and GitHub release with changelog. - Publish: Publish packages to pub.dev in dependency order: platform_interface → zstandard_native (shared C source) → platform implementations (android, ios, macos, linux, windows, web) → zstandard_cli and zstandard.
The workflow uses self-hosted runners for macOS, Linux, and Windows to build native binaries and run platform-specific steps.
File: .github/workflows/hotfix_workflow.yml
Used for expedited fixes (e.g. security or critical bugs). Typically triggered manually and may skip some steps or use a shorter path to release. See the workflow file and team docs for details.
To mimic CI locally:
- Analyze:
flutter analyzeordart analyzein each package. - Test:
flutter testordart testin each package. - Test with coverage:
flutter test --coverage(Flutter) ordart test --coverage=coveragethen format (CLI). - All packages: Use the test scripts (e.g.
./scripts/test_all.shorscripts\test_all.bat).
Scripts under scripts/ help build native libraries and run tests locally:
build_macos.sh,build_linux.sh,build_windows.bat: Build precompiled zstd libraries for the CLI.build_android.sh,build_ios.sh: Build or prepare the Android/iOS plugin.- Each of
zstandard_ios/scripts/sync_zstd.shandzstandard_macos/scripts/sync_zstd.shsyncs the canonical zstd C source (zstandard_native/src/zstd/) into that plugin’sClasses/zstd/tree. regenerate_bindings.sh: Regenerate FFI bindings (ffigen) for all platform packages after zstd source updates.test_all.sh/test_all.bat: Run tests in all packages.coverage_report.sh/coverage_report.bat: Generate coverage reports.
See the script contents and Building for requirements (CMake, NDK, Xcode, etc.).