PyAppify release flow

ok-bd2 follows the release shape used by BnanZ0/ok-nte.

What the installed EXE does

The user downloads a single installer such as ok-bd2-win32-China-setup-1.4.13.exe. After installation, Windows starts an outer launcher ok-bd2.exe. That launcher is generated by PyAppify. It opens the white update window, checks the configured update repository, installs Python dependencies when needed, syncs the app code into its working directory, and then runs main.py.

The dark ok-script window is still created by the existing application entry:

ok-bd2.exe -> PyAppify launcher/update window -> main.py -> ok.OK(config).start()

No separate update UI is needed in main.py.

Source repository vs update repository

The main repository keeps source code, tests, docs, and training material. The update repository is intentionally smaller and is generated during release.

deploy.txt is the sync list for the update repository. The core payload builder bundles ok-script, pyappify, and PP-OCRv6 in the update tree and removes their pins from the payload requirements. Installed releases load PP-OCRv6 from the versioned ocr_bundle/onnxocr directory. Older releases keep loading their installed PP-OCRv5 even if the launcher preserves that directory when switching tags. The builder replaces the src/config.py marker version = "release-tag-unset" with the tag being released. The source package version has one authority: pyproject.toml (currently 0.1.1), which src.config.runtime_version() reads whenever that file is present. Generated update content excludes pyproject.toml, so runtime_version() falls back to the inlined release tag there. A PyAppify tag, such as v0.1.18, identifies the update delivery and does not by itself change the package version.

Required repositories and secrets

Create these repositories before publishing a tag:

https://github.com/GodRaymond233/ok-bd2
https://github.com/GodRaymond233/ok-bd2-update
https://cnb.cool/GodRaymond233/ok-bd2-update.git

Configure these GitHub Actions secrets:

OK_GH     GitHub token that can push to GodRaymond233/ok-bd2-update
CNB_GH    CNB token that can push to cnb.cool/GodRaymond233/ok-bd2-update.git

Packaging modes

The Build workflow supports two modes. Configure the repository Actions variable PACKAGE_BUILD_MODE to switch between them; a missing or empty value defaults to fast.

Value NSIS compression China/Global strategy Intended use
fast ZLIB Built sequentially in one job Normal releases; prioritizes build speed
compact LZMA Built in parallel matrix jobs Smaller installers; accepts more compression time

Both modes always publish the China full installer, Global full installer, online installer, launcher ZIP, and checksum. Global packaging is not optional and the workflow fails if its installer is missing.

When launcher inputs have not changed since the previous release, both modes reuse the launcher from the previous ok-bd2-win32.zip. Changes to pyappify.yml, icons/, or scripts/prepare_pyappify_launcher.ps1 disable reuse automatically and force a fresh launcher compilation. This makes reuse a safe optimization instead of a manual release setting.

The launcher source is pinned to PyAppify 1.2.4. Preparation and packaging use RUNNER_TEMP/p in Actions (p/ for local builds). Reused launchers must be at least 1.2.4, because setup selects the exact application tag before installing dependencies and the action checks that the prepared app.json names that tag. Installer filenames include the application version; the launcher ZIP keeps its fixed name for existing update URLs.

To switch modes, open the repository's Settings → Secrets and variables → Actions → Variables, create or edit PACKAGE_BUILD_MODE, and set it to fast or compact. The value is read at the start of every tag build, so no workflow edit or commit is required when switching.

The manual Check installer workflow packages an explicitly selected tag that already exists in both update repositories. It runs the checked-out branch's tests and validates its inlined payload separately, then uploads installer artifacts without synchronizing update repositories or publishing a release. The installer payload is the selected existing tag, not unpublished changes from the checked-out branch.

Publishing

Use a stable semantic version tag. The build workflow only creates installer assets for tags like v0.1.0.

Before creating the tag, confirm it names the intended delivery revision. Do not change pyproject.toml merely to match a historical PyAppify tag; change it only when making an intentional package-version release.

git tag v0.1.0
git push origin v0.1.0

The workflow will:

  1. Install dependencies and run the final quality gate on Windows.
  2. Validate the dependency lock and inline ok-script and PyAppify for the update repository.
  3. Validate the inlined update payload, including the PP-OCRv6 models, dictionary and license, and check that the visualization font, orientation model and demo are excluded.
  4. Sync the update repositories using deploy.txt.
  5. Resolve PACKAGE_BUILD_MODE and safely reuse or compile the PyAppify launcher.
  6. Prepare the exact application tag and build both China and Global installer assets from pyappify.yml.
  7. Validate every required download before publishing the GitHub Release.
在 GitHub 查看源文件 ↗ · 页面生成时间: 2026年11月25日