Skip to content

Building and releasing ​

Language / 语言: 中文 · English

Use the same toolchain locally as in CI. Version and release configuration live in pubspec.yaml, .release-please-manifest.json, .release-policy.yml, and .github/workflows/release.yml.

Development environment ​

Install Flutter 3.47.1 and the build tools for your target. Android needs the Android SDK; build macOS on macOS and Windows on Windows.

shell
flutter doctor
flutter pub get
flutter devices
flutter run -d <device-id>

Desktop device IDs are macos and windows. For Android, use an ID from flutter devices. The app includes a public OAuth client ID. To use your own app, add --dart-define=DAKIT_CLIENT_ID=YOUR_PUBLIC_CLIENT_ID and register dakit://oauth/callback.

Pinned toolchain ​

ComponentPinned versionConfiguration
Flutter3.47.1.github/workflows/ci.yml, .release-policy.yml
Android Gradle Plugin8.13.2android/settings.gradle.kts
Gradle8.14.2android/gradle/wrapper/gradle-wrapper.properties
Kotlin2.2.20android/settings.gradle.kts
flutter_inappwebview6.1.5 (exact)pubspec.yaml

When upgrading Flutter or the WebView plugin, verify compilation of both the Android and macOS sub-packages.

Validation and builds ​

For Dart changes, run the same quality checks as CI before committing:

shell
dart format --output=none --set-exit-if-changed lib test
flutter analyze
flutter test

Run release builds on the corresponding platform:

shell
flutter build apk --release --dart-define=DAVIEWER_VERSION=0.5.10      # Requires android/key.properties
flutter build macos --release --dart-define=DAVIEWER_VERSION=0.5.10
flutter build windows --release --dart-define=DAVIEWER_VERSION=0.5.10

Replace the sample 0.5.10 with the version from pubspec.yaml, excluding the build number after +. Native package metadata does not set this Dart define; automatic update checks need it. CI passes the release version in scripts/build-release.

Android release builds require the upload keystore and android/key.properties; missing configuration fails the build. CI uses KEYSTORE_B64 and KEYSTORE_PROPERTIES. A PR dry-run without signing secrets can build a debug APK, but that APK cannot serve as a production release.

The current macOS script runs a Flutter release build and archives DAViewer.app. It has no stable preview-certificate import, Developer ID signing, or notarization step. The artifact keeps the macos-unsigned-preview name. Local ad-hoc signing or a missing TeamIdentifier is an environment limit. Verify Keychain access after upgrades on a real device; signing identity continuity is not guaranteed.

Release workflow ​

.github/workflows/release.yml calls ReleaseGraph. .release-policy.yml selects release-please versioning, three-platform builds, asset validation, and retention. PRs run in dry-run mode; pushes to main, scheduled runs, and manual dispatch enter the release workflow. The current workflow has no v* tag-push trigger.

  1. Manage version changes through release-please and check pubspec.yaml against .release-please-manifest.json.
  2. Write Chinese notes in .github/release-notes/<version>.md, including a 本次更新 section. CI checks that the current manifest version has a notes file containing Chinese. Keep notes end-user facing: one sentence per change, about four bullets total, no root-cause analysis, log timestamps, or internal component names (style rules in .github/release-notes/README.md).
  3. Pass quality, build, and asset checks. Manual acceptance requirements are in the Release gate (Chinese).
  4. After publishing, the script updates both download pages and dispatches Pages deployment. CHANGELOG.md and RELEASE_NOTES.md retain past changes.

For a manual run, open Actions → Release → Run workflow:

InputPurpose
versionExisting version; leave blank to read the manifest
dry_runBuild and validate without publishing
forceRerun a healthy version
repairRepair the current incomplete version
stageRecovery stage label; defaults to all

Asset names are DAViewer-v<version>.apk, DAViewer-v<version>-windows.zip, and DAViewer-v<version>-macos-unsigned-preview.zip. Retention keeps one stable release, one prerelease, and two failed drafts. Release-page retention does not describe source-history retention.

Build proxies ​

Configure build-tool proxies separately from the app proxy. Ports 7890 and 7892 below are examples; replace them with the HTTP/Mixed port shown by your proxy app.

Bash / zsh:

bash
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export no_proxy=localhost,127.0.0.1
flutter pub get

PowerShell:

powershell
$env:http_proxy = 'http://127.0.0.1:7890'
$env:https_proxy = 'http://127.0.0.1:7890'
$env:no_proxy = 'localhost,127.0.0.1'
flutter pub get

Gradle runs on the JVM. Set JVM proxy properties explicitly when Android toolchain downloads need a proxy:

bash
export GRADLE_OPTS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=7892 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=7892"
flutter build apk --debug
powershell
$env:GRADLE_OPTS = '-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=7892 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=7892'
flutter build apk --debug