diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 2a0cdc8f..100ba55d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -40,7 +40,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 70bcd1a1..c72c1018 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -115,7 +115,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml index 81b5adc0..d65ea691 100644 --- a/.github/workflows/linux_arm64.yml +++ b/.github/workflows/linux_arm64.yml @@ -67,7 +67,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linux_py.yml b/.github/workflows/linux_py.yml index 86acdb54..bd47ea09 100644 --- a/.github/workflows/linux_py.yml +++ b/.github/workflows/linux_py.yml @@ -152,7 +152,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2cd38dd3..b2caeee6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -51,7 +51,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/macos_py.yml b/.github/workflows/macos_py.yml index 2c29a076..afbcffec 100644 --- a/.github/workflows/macos_py.yml +++ b/.github/workflows/macos_py.yml @@ -60,7 +60,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8061fa16..cb6b8bfe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -48,7 +48,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows_py.yml b/.github/workflows/windows_py.yml index 678177d3..a2584507 100644 --- a/.github/workflows/windows_py.yml +++ b/.github/workflows/windows_py.yml @@ -66,7 +66,7 @@ jobs: retention-days: 90 - name: issue评论 - if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test' && vars.VERSION_ISSUE_NO != '' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package/build_linux_arm64.sh b/package/build_linux_arm64.sh index f5ac6ea6..c5693586 100644 --- a/package/build_linux_arm64.sh +++ b/package/build_linux_arm64.sh @@ -5,8 +5,74 @@ set -euxo pipefail export DEBIAN_FRONTEND=noninteractive if command -v apt-get >/dev/null 2>&1; then - apt-get update - apt-get install -y --no-install-recommends \ + # Debian 11(bullseye)已结束支持,deb.debian.org 不再保留其软件包,apt-get 会因 404 整体失败。 + # 归档站仅保留主仓库:bullseye-updates 为空、bullseye-security 尚未归档,故只配置 main 一条。 + # 仅在 debian:11 容器内改写,避免影响其它发行版或原生 arm64 主机。 + # Debian 11 (bullseye) is end-of-life and deb.debian.org no longer serves its packages, so + # apt-get fails outright with 404. The archive keeps the main suite only: bullseye-updates is + # empty and bullseye-security is not archived, hence the single entry below. + # Rewrite it only inside a debian:11 container, never on other releases or a native arm64 host. + OS_TAG="" + if [ -r /etc/os-release ]; then + OS_TAG="$(. /etc/os-release && echo "${ID:-}-${VERSION_ID:-}")" + fi + if [ "${OS_TAG}" = "debian-11" ]; then + echo "deb http://archive.debian.org/debian bullseye main" > /etc/apt/sources.list + rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true + # 归档快照的 Release 早已超出有效期,需要放行该校验,否则 apt-get update 仍会拒绝 + # The archived Release is long past its Valid-Until, so that check must be relaxed + # or apt-get update still refuses the repository + echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99archive-no-check-valid-until + apt-get update + # 镜像内预装的包来自 bullseye-security,版本高于归档主仓库(如 libc6 u14 对 u11)。 + # 该仓库的索引虽在、软件包却已下线(其 pool 下的 deb 均返回 404),这些版本已无处可取; + # 而 libc6-dev、perl 都要求与 libc6、perl-base 精确同版本,故须先把已装包对齐到归档主仓库。 + # dist-upgrade 只做升级、不会主动降级(--allow-downgrades 仅是放行降级动作), + # 因此逐个比对已装版本与候选版本,显式降级存在差异者。 + # The image ships packages from bullseye-security whose versions outrank the archived main + # suite (e.g. libc6 u14 vs u11). That suite still serves indexes but no longer serves the + # packages themselves (its pool returns 404), so those versions are unobtainable; since + # libc6-dev and perl demand an exact version match against libc6 and perl-base, the installed + # set must first be aligned onto the archive. dist-upgrade only upgrades and never downgrades + # on its own (--allow-downgrades merely permits the action), so compare the installed version + # against the candidate for each package and downgrade the ones that differ. + set +x + # 包名取 ${binary:Package} 以带上架构后缀,并与版本一次查出: + # 若按包名二次查询,multi-arch 包会返回多条记录且无分隔,版本串会被拼接成非法值 + # Take ${binary:Package} so the architecture suffix is kept, and read the version in the + # same query: looking the version up by bare name afterwards returns one record per + # architecture with no separator, concatenating them into an invalid version string + installed_list="$(dpkg-query -W -f='${db:Status-Abbrev}|${binary:Package}|${Version}\n' \ + | awk -F'|' '$1 ~ /^ii/ {print $2"|"$3}')" + realign="" + while IFS='|' read -r pkg installed; do + [ -n "${pkg}" ] || continue + # 不能用 apt-cache policy 的 Candidate:它表示"apt 会选用的版本",而 apt 默认不降级, + # 对已装版本高于源的包它恒等于已装版本,比对将永远相等。 + # madison 只列出源中实际提供的版本(按版本降序),取其首行才是源里的可用版本。 + # apt-cache 的输出随 locale 变化,固定为 C 以稳定解析。 + # The Candidate from apt-cache policy cannot be used: it denotes the version apt would + # select, and since apt never downgrades on its own it equals the installed version + # whenever that outranks the archive, making every comparison match. + # madison lists only what the configured sources actually offer (newest first), so its + # first row is the version available from the archive. + # apt-cache output is localized, so pin the locale to C for stable parsing. + available="$(LC_ALL=C apt-cache madison "${pkg}" 2>/dev/null \ + | awk -F'|' 'NR==1{gsub(/ /,"",$2); print $2}' || true)" + if [ -n "${available}" ] && [ "${available}" != "${installed}" ]; then + realign="${realign} ${pkg}=${available}" + fi + done </dev/null 2>&1; then