Skip to content

Add a Bazel-oriented source package profile and extract the release logic - #1484

Merged
frankslin merged 1 commit into
BYVoid:masterfrom
frankslin:upstream-master
Aug 23, 2026
Merged

frankslin merged 1 commit into
BYVoid:masterfrom
frankslin:upstream-master

Conversation

@frankslin

Copy link
Copy Markdown
Collaborator

Adds OPENCC_SOURCE_PACKAGE_PROFILE=bazel, a trimmed source package that keeps the Node.js and Python binding sources so the //node and //python Bazel targets stay buildable and testable from the tarball, and moves the build/smoke-test logic out of release-source.yml into a reusable shell script.

Detailed Changes:

  • CMakeLists.txt:
    • Split the trimmed ignore list into a shared part and a binding-sources part (node/, python/, scripts/), so the new "bazel" profile keeps them while "opencc" drops them. The "opencc" package contents are unchanged.
    • Both trimmed profiles now drop the npm/PyPI packaging entry points (package.json, package-lock.json, pyproject.toml, setup.py, MANIFEST.in, plugins/jieba/node/); Bazel does not need them.
    • Replace the "/python[^/]/" pattern, which also happened to exclude deps/marisa-/bindings/python[3]/, with explicit patterns so the OpenCC python/ directory can be kept independently.
  • scripts/build-source-package.sh (new): build / smoke-test / all subcommands taking a profile. Builds the CPack archive, repacks it for reproducibility, then smoke-tests it with CMake and Bazel; the "bazel" profile additionally runs the full CI Bazel build and test target patterns. Explicit target patterns are used instead of //... because the vendored deps/googletest-1.15.0 BUILD files do not load under current Bazel versions. Fixes the CMake smoke-test target name, which was opencc-jieba (the library OUTPUT_NAME) instead of the actual target opencc_jieba.
  • .github/workflows/release-source.yml: run the script once per profile via a build matrix; artifacts and release assets are uploaded per profile.
  • Docs: update the source package section in AGENTS.md and the NEWS.md entry; ignore /build-src.

…ogic

Adds OPENCC_SOURCE_PACKAGE_PROFILE=bazel, a trimmed source package that keeps
the Node.js and Python binding sources so the //node and //python Bazel targets
stay buildable and testable from the tarball, and moves the build/smoke-test
logic out of release-source.yml into a reusable shell script.

Detailed Changes:
- **CMakeLists.txt**:
  - Split the trimmed ignore list into a shared part and a binding-sources part
    (node/, python/, scripts/), so the new "bazel" profile keeps them while
    "opencc" drops them. The "opencc" package contents are unchanged.
  - Both trimmed profiles now drop the npm/PyPI packaging entry points
    (package.json, package-lock.json, pyproject.toml, setup.py, MANIFEST.in,
    plugins/jieba/node/); Bazel does not need them.
  - Replace the "/python[^/]*/" pattern, which also happened to exclude
    deps/marisa-*/bindings/python[3]/, with explicit patterns so the OpenCC
    python/ directory can be kept independently.
- **scripts/build-source-package.sh** (new): build / smoke-test / all
  subcommands taking a profile. Builds the CPack archive, repacks it for
  reproducibility, then smoke-tests it with CMake and Bazel; the "bazel"
  profile additionally runs the full CI Bazel build and test target patterns.
  Explicit target patterns are used instead of //... because the vendored
  deps/googletest-1.15.0 BUILD files do not load under current Bazel versions.
  Fixes the CMake smoke-test target name, which was opencc-jieba (the library
  OUTPUT_NAME) instead of the actual target opencc_jieba.
- **.github/workflows/release-source.yml**: run the script once per profile via
  a build matrix; artifacts and release assets are uploaded per profile.
- **Docs**: update the source package section in AGENTS.md and the NEWS.md
  entry; ignore /build-src.
@frankslin
frankslin merged commit aec79a4 into BYVoid:master Aug 23, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant