diff --git a/.github/scripts/codec-checksums.sh b/.github/scripts/codec-checksums.sh index 4c92af8..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,7 +22,8 @@ while IFS='=' read -r var ver; do exit 1 fi url=${template//"\${${var}}"/$ver} - sha=$(curl -fsSL --retry 3 "$url" | sha256sum | cut -d' ' -f1) + curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors -o "$tmp" "$url" + sha=$(sha256sum "$tmp" | 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..6f349da 100644 --- a/.github/workflows/validate-workflows.yml +++ b/.github/workflows/validate-workflows.yml @@ -23,10 +23,13 @@ jobs: - name: Install actionlint id: install shell: bash + env: + ACTIONLINT_VERSION: v1.7.12 + ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 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) + 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/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..21f3733 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,16 @@ { "$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", + "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_SHA256:\\s*(?[a-f0-9]{64})" + ], + "datasourceTemplate": "github-release-attachments", + "depNameTemplate": "rhysd/actionlint" + } + ] }