From 2aa9eb9d5c5d4d087589c6facce6f48c1aecd292 Mon Sep 17 00:00:00 2001 From: Frank Lin Date: Sun, 12 Jul 2026 07:57:05 -0700 Subject: [PATCH 1/3] Install build-essential in the Debian package workflow dpkg-checkbuilddeps requires the build-essential meta package for every build (build-essential:native also for cross builds), and the GitHub runner image provides the compilers without the meta package, so both deb jobs aborted before building. Add it to the amd64 and arm64 dependency installs. --- .github/workflows/release-deb.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-deb.yml b/.github/workflows/release-deb.yml index baca200d9..8ca3e67ad 100644 --- a/.github/workflows/release-deb.yml +++ b/.github/workflows/release-deb.yml @@ -22,7 +22,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ - debhelper cmake ninja-build pkg-config doxygen \ + build-essential debhelper cmake ninja-build pkg-config doxygen \ libmarisa-dev rapidjson-dev libtclap-dev \ googletest libgtest-dev @@ -72,7 +72,7 @@ jobs: sudo dpkg --add-architecture arm64 sudo apt-get update sudo apt-get install -y --no-install-recommends \ - debhelper cmake ninja-build pkg-config \ + build-essential debhelper cmake ninja-build pkg-config \ crossbuild-essential-arm64 \ libmarisa-dev:arm64 rapidjson-dev libtclap-dev \ googletest libgtest-dev From d4495987f1f05122542c5095b60f89ae592aa847 Mon Sep 17 00:00:00 2001 From: Frank Lin Date: Sun, 12 Jul 2026 07:57:51 -0700 Subject: [PATCH 2/3] Allow uploading dispatched Debian builds to an existing release Add a release_tag input to the Debian package workflow so a manual workflow_dispatch run can attach its packages to an already-created release. Tag-triggered runs execute the workflow definition frozen at the tag, so a fix to the workflow itself needs a dispatch from master with a way to reach the release assets. --- .github/workflows/release-deb.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-deb.yml b/.github/workflows/release-deb.yml index 8ca3e67ad..76f8cca12 100644 --- a/.github/workflows/release-deb.yml +++ b/.github/workflows/release-deb.yml @@ -2,6 +2,11 @@ name: Debian Packages on: workflow_dispatch: + inputs: + release_tag: + description: "Existing release tag to upload the built packages to, for example ver.1.4.1. Leave empty to only build artifacts." + required: false + type: string push: tags: - "ver.*" @@ -126,11 +131,11 @@ jobs: path: dist/opencc-*.zip - name: Upload to GitHub release - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || inputs.release_tag != '' env: GH_TOKEN: ${{ github.token }} run: | - tag="${{ github.ref_name }}" + tag="${{ inputs.release_tag || github.ref_name }}" for i in $(seq 1 30); do gh release view "$tag" --json isDraft > /dev/null 2>&1 && break echo "Waiting for release $tag to be created ($i/30)..." From 681cd995849ac0b3fd7c6533c42c226c7dd7a01c Mon Sep 17 00:00:00 2001 From: Frank Lin Date: Sun, 12 Jul 2026 08:14:01 -0700 Subject: [PATCH 3/3] Package Debian release assets as one zip per architecture Bundle the per-architecture debs (plus the architecture-independent packages, so each zip installs on its own) with a SHA256SUMS file into opencc--deb-.zip, upload only the two zips to the GitHub release, and point the README download links at them instead of individual deb files. --- .github/workflows/release-deb.yml | 16 ++++++++++++---- README.md | 7 ++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-deb.yml b/.github/workflows/release-deb.yml index 76f8cca12..89f5578c4 100644 --- a/.github/workflows/release-deb.yml +++ b/.github/workflows/release-deb.yml @@ -119,11 +119,19 @@ jobs: -l packaging/debian/debian/changelog -S version) echo "value=$VERSION" >> "$GITHUB_OUTPUT" - - name: Assemble zip with checksums + - name: Assemble per-architecture zips with checksums run: | cd dist - sha256sum ./*.deb > SHA256SUMS - zip "opencc-${{ steps.version.outputs.value }}-deb.zip" ./*.deb SHA256SUMS + version="${{ steps.version.outputs.value }}" + for arch in amd64 arm64; do + stage="deb-$arch-stage" + mkdir "$stage" + cp ./*_"$arch".deb "$stage"/ + cp ./*_all.deb "$stage"/ + (cd "$stage" && sha256sum ./*.deb > SHA256SUMS && \ + zip "../opencc-$version-deb-$arch.zip" ./*.deb SHA256SUMS) + rm -r "$stage" + done - uses: actions/upload-artifact@v4 with: @@ -142,5 +150,5 @@ jobs: sleep 10 done gh release upload "$tag" \ - "dist/opencc-${{ steps.version.outputs.value }}-deb.zip" \ + dist/opencc-*-deb-*.zip \ --clobber diff --git a/README.md b/README.md index b667c93b9..8f03c0a32 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ OpenCC 1.4.1 修復 `opencc` npm 套件在無預編譯二進制平台上源碼 * Windows (x86_64): [OpenCC-1.4.1](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip) ([SHA-256](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/OpenCC-1.4.1-windows-x64-portable.zip.sha256)) * This Windows release is available from WinGet. For details, see [doc/windows-winget-release.md](doc/windows-winget-release.md). * Requires Microsoft Visual C++ Redistributable for Visual Studio 2015-2026. Download the latest version from [Microsoft](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-supported-redistributable-version). -* Debian/Ubuntu (amd64): - * [opencc_1.4.1_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc_1.4.1_amd64.deb) - * [opencc-jieba_1.4.1_amd64.deb](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-jieba_1.4.1_amd64.deb) +* Debian/Ubuntu: + * [opencc-1.4.1-1-deb-amd64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-1.4.1-1-deb-amd64.zip) + * [opencc-1.4.1-1-deb-arm64.zip](https://github.com/BYVoid/OpenCC/releases/download/ver.1.4.1/opencc-1.4.1-1-deb-arm64.zip) + * Each zip bundles the `opencc`, `opencc-jieba`, and `libopencc*` deb packages for one architecture, with a `SHA256SUMS` file. ## Usage 使用