From 41468ba275de559f959583bd43ebdefbcbc267cd Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Tue, 27 Oct 2026 08:24:40 +0800 Subject: [PATCH 1/4] ci: retry downloads; Renovate tracks actionlint's tag and commit A TLS reset fetching libogg failed #27's build; --retry-all-errors covers it, where plain --retry skips connect errors. actionlint's binary floated to latest while its script was pinned by commit; both now move together. --- .github/scripts/codec-checksums.sh | 2 +- .github/workflows/validate-workflows.yml | 8 +++++--- linux/Dockerfile | 10 +++++----- renovate.json | 14 +++++++++++++- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/scripts/codec-checksums.sh b/.github/scripts/codec-checksums.sh index 4c92af8..f04b0f4 100755 --- a/.github/scripts/codec-checksums.sh +++ b/.github/scripts/codec-checksums.sh @@ -19,7 +19,7 @@ while IFS='=' read -r var ver; do exit 1 fi url=${template//"\${${var}}"/$ver} - sha=$(curl -fsSL --retry 3 "$url" | sha256sum | cut -d' ' -f1) + sha=$(curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "$url" | sha256sum | cut -d' ' -f1) sed "s/^ARG ${lib}_SHA256=.*/ARG ${lib}_SHA256=${sha}/" "$dockerfile" > "${dockerfile}.tmp" mv "${dockerfile}.tmp" "$dockerfile" diff --git a/.github/workflows/validate-workflows.yml b/.github/workflows/validate-workflows.yml index 6fe2c82..c78b1f6 100644 --- a/.github/workflows/validate-workflows.yml +++ b/.github/workflows/validate-workflows.yml @@ -23,10 +23,12 @@ jobs: - name: Install actionlint id: install shell: bash + env: + ACTIONLINT_VERSION: v1.7.12 + ACTIONLINT_COMMIT: 914e7df21a07ef503a81201c76d2b11c789d3fca run: | - # download-actionlint.bash pinned to the rhysd/actionlint v1.7.12 commit - # (immutable ref) so a re-pointed tag can't inject code into CI. - bash <(curl -sSfL https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash) + # The script comes from the commit the tag pointed at (immutable), so a re-pointed tag can't inject code. + bash <(curl -sSfL --retry 5 --retry-delay 2 --retry-all-errors "https://raw.githubusercontent.com/rhysd/actionlint/${ACTIONLINT_COMMIT}/scripts/download-actionlint.bash") "${ACTIONLINT_VERSION#v}" echo "exe=$PWD/actionlint" >> "$GITHUB_OUTPUT" - name: Run actionlint diff --git a/linux/Dockerfile b/linux/Dockerfile index 9f3df45..229e05e 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -52,35 +52,35 @@ WORKDIR /src # Usage handled inline per-library below. # --- libmp3lame (LGPL) — MP3 encoding --- -RUN curl -fsSL "https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz" -o lame.tar.gz \ +RUN curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz" -o lame.tar.gz \ && echo "${LAME_SHA256} lame.tar.gz" | sha256sum -c - \ && tar xf lame.tar.gz && cd "lame-${LAME_VERSION}" \ && ./configure --prefix="${PREFIX}" --enable-static --disable-shared --disable-frontend \ && make -j"$(nproc)" && make install # --- libogg (BSD) — container for Vorbis --- -RUN curl -fsSL "https://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.xz" -o ogg.tar.xz \ +RUN curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "https://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.xz" -o ogg.tar.xz \ && echo "${OGG_SHA256} ogg.tar.xz" | sha256sum -c - \ && tar xf ogg.tar.xz && cd "libogg-${OGG_VERSION}" \ && ./configure --prefix="${PREFIX}" --enable-static --disable-shared \ && make -j"$(nproc)" && make install # --- libvorbis (BSD) — Vorbis encoding --- -RUN curl -fsSL "https://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.xz" -o vorbis.tar.xz \ +RUN curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "https://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.xz" -o vorbis.tar.xz \ && echo "${VORBIS_SHA256} vorbis.tar.xz" | sha256sum -c - \ && tar xf vorbis.tar.xz && cd "libvorbis-${VORBIS_VERSION}" \ && ./configure --prefix="${PREFIX}" --enable-static --disable-shared \ && make -j"$(nproc)" && make install # --- libopus (BSD) — Opus encoding/decoding --- -RUN curl -fsSL "https://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz" -o opus.tar.gz \ +RUN curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "https://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz" -o opus.tar.gz \ && echo "${OPUS_SHA256} opus.tar.gz" | sha256sum -c - \ && tar xf opus.tar.gz && cd "opus-${OPUS_VERSION}" \ && ./configure --prefix="${PREFIX}" --enable-static --disable-shared \ && make -j"$(nproc)" && make install # --- opencore-amr (Apache-2.0) — AMR-NB encoding (Sleezer AMR target) --- -RUN curl -fsSL "https://downloads.sourceforge.net/opencore-amr/opencore-amr-${OPENCORE_AMR_VERSION}.tar.gz" -o amr.tar.gz \ +RUN curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "https://downloads.sourceforge.net/opencore-amr/opencore-amr-${OPENCORE_AMR_VERSION}.tar.gz" -o amr.tar.gz \ && echo "${OPENCORE_AMR_SHA256} amr.tar.gz" | sha256sum -c - \ && tar xf amr.tar.gz && cd "opencore-amr-${OPENCORE_AMR_VERSION}" \ && ./configure --prefix="${PREFIX}" --enable-static --disable-shared \ diff --git a/renovate.json b/renovate.json index 1b52fb3..4cd248f 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,17 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>chodeus/chodeus-ops"], - "gitIgnoredAuthors": ["41898282+github-actions[bot]@users.noreply.github.com"] + "gitIgnoredAuthors": ["41898282+github-actions[bot]@users.noreply.github.com"], + "customManagers": [ + { + "customType": "regex", + "description": "actionlint's tag and the commit it points at in validate-workflows.yml; the install script is fetched by that commit.", + "managerFilePatterns": ["/^\\.github/workflows/validate-workflows\\.yml$/"], + "matchStrings": [ + "ACTIONLINT_VERSION:\\s*(?v[^\\s]+)\\s+ACTIONLINT_COMMIT:\\s*(?[a-f0-9]{40})" + ], + "datasourceTemplate": "github-tags", + "depNameTemplate": "rhysd/actionlint" + } + ] } From ee0f7e7057241d9faed07bc32999fd1e28100795 Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Tue, 27 Oct 2026 09:34:02 +0800 Subject: [PATCH 2/4] ci: hash a downloaded file, and pin actionlint's tarball by SHA-256 A retried curl can append to a pipe, so the checksum script downloads to a file first. actionlint now comes from its release tarball, checked against a SHA-256 Renovate moves with the tag, instead of an installer script piped into bash. --- .github/scripts/codec-checksums.sh | 6 +++++- .github/workflows/validate-workflows.yml | 7 ++++--- renovate.json | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/scripts/codec-checksums.sh b/.github/scripts/codec-checksums.sh index f04b0f4..49bd1ed 100755 --- a/.github/scripts/codec-checksums.sh +++ b/.github/scripts/codec-checksums.sh @@ -19,7 +19,11 @@ while IFS='=' read -r var ver; do exit 1 fi url=${template//"\${${var}}"/$ver} - sha=$(curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors "$url" | sha256sum | cut -d' ' -f1) + # To a file, not a pipe: curl can truncate a file before a retry, but would append to a pipe. + tmp=$(mktemp) + curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors -o "$tmp" "$url" + sha=$(sha256sum "$tmp" | cut -d' ' -f1) + rm -f "$tmp" sed "s/^ARG ${lib}_SHA256=.*/ARG ${lib}_SHA256=${sha}/" "$dockerfile" > "${dockerfile}.tmp" mv "${dockerfile}.tmp" "$dockerfile" diff --git a/.github/workflows/validate-workflows.yml b/.github/workflows/validate-workflows.yml index c78b1f6..6f349da 100644 --- a/.github/workflows/validate-workflows.yml +++ b/.github/workflows/validate-workflows.yml @@ -25,10 +25,11 @@ jobs: shell: bash env: ACTIONLINT_VERSION: v1.7.12 - ACTIONLINT_COMMIT: 914e7df21a07ef503a81201c76d2b11c789d3fca + ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 run: | - # The script comes from the commit the tag pointed at (immutable), so a re-pointed tag can't inject code. - bash <(curl -sSfL --retry 5 --retry-delay 2 --retry-all-errors "https://raw.githubusercontent.com/rhysd/actionlint/${ACTIONLINT_COMMIT}/scripts/download-actionlint.bash") "${ACTIONLINT_VERSION#v}" + curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors -o actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION#v}_linux_amd64.tar.gz" + echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c - + tar xzf actionlint.tar.gz actionlint echo "exe=$PWD/actionlint" >> "$GITHUB_OUTPUT" - name: Run actionlint diff --git a/renovate.json b/renovate.json index 4cd248f..eb9b844 100644 --- a/renovate.json +++ b/renovate.json @@ -5,12 +5,12 @@ "customManagers": [ { "customType": "regex", - "description": "actionlint's tag and the commit it points at in validate-workflows.yml; the install script is fetched by that commit.", + "description": "actionlint's release tag and tarball SHA-256 in validate-workflows.yml; Renovate takes the same asset's hash from the new release.", "managerFilePatterns": ["/^\\.github/workflows/validate-workflows\\.yml$/"], "matchStrings": [ - "ACTIONLINT_VERSION:\\s*(?v[^\\s]+)\\s+ACTIONLINT_COMMIT:\\s*(?[a-f0-9]{40})" + "ACTIONLINT_VERSION:\\s*(?v[^\\s]+)\\s+ACTIONLINT_SHA256:\\s*(?[a-f0-9]{64})" ], - "datasourceTemplate": "github-tags", + "datasourceTemplate": "github-release-attachments", "depNameTemplate": "rhysd/actionlint" } ] From 8c0426d0f7ca1c8767d14c4e50f012a4795b080c Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Tue, 27 Oct 2026 10:40:15 +0800 Subject: [PATCH 3/4] ci: one temp file for the checksum downloads, removed on any exit --- .github/scripts/codec-checksums.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/codec-checksums.sh b/.github/scripts/codec-checksums.sh index 49bd1ed..a4f2362 100755 --- a/.github/scripts/codec-checksums.sh +++ b/.github/scripts/codec-checksums.sh @@ -6,6 +6,9 @@ set -euo pipefail dockerfile=linux/Dockerfile base=${1:?usage: codec-checksums.sh } base_file=$(git show "${base}:${dockerfile}") +# To a file, not a pipe: curl truncates a file before a retry, but would append to a pipe. +tmp=$(mktemp) +trap 'rm -f "$tmp"' EXIT while IFS='=' read -r var ver; do lib=${var%_VERSION} @@ -19,11 +22,8 @@ while IFS='=' read -r var ver; do exit 1 fi url=${template//"\${${var}}"/$ver} - # To a file, not a pipe: curl can truncate a file before a retry, but would append to a pipe. - tmp=$(mktemp) curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors -o "$tmp" "$url" sha=$(sha256sum "$tmp" | cut -d' ' -f1) - rm -f "$tmp" sed "s/^ARG ${lib}_SHA256=.*/ARG ${lib}_SHA256=${sha}/" "$dockerfile" > "${dockerfile}.tmp" mv "${dockerfile}.tmp" "$dockerfile" From 360a4f7f37dbf6d1d74f851453e0dae2337fd034 Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Tue, 27 Oct 2026 11:31:32 +0800 Subject: [PATCH 4/4] chore(renovate): take gitIgnoredAuthors from the chodeus-ops preset --- renovate.json | 1 - 1 file changed, 1 deletion(-) diff --git a/renovate.json b/renovate.json index eb9b844..21f3733 100644 --- a/renovate.json +++ b/renovate.json @@ -1,7 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["github>chodeus/chodeus-ops"], - "gitIgnoredAuthors": ["41898282+github-actions[bot]@users.noreply.github.com"], "customManagers": [ { "customType": "regex",