mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
ci: track the latest mdPress release instead of a per-repo pinned version
Per the author: mdPress should default to the latest release. The cluster had drifted to three versions (0.7.10 x4, 0.7.11 x9, 0.7.14 x1), and nine of those were pinned to bytes upstream had rebuilt under an existing tag — the exact thing the harness move to 0.7.14 refused to do on principle. Pinning also took CI down cluster-wide twice when a tag was rebuilt, because the digest no longer matched. Latest is now 0.7.15; nothing was on it. Each of the 43 install sites now resolves the newest release at build time by following the /releases/latest redirect (no api.github.com call, so no unauthenticated rate limit on shared runner IPs) and exports the version via GITHUB_ENV. Integrity is kept, not dropped: the archive is verified against that same release's published checksums.txt, and a missing entry aborts the step rather than passing silently. The honest trade-off is that this verifies the download rather than pinning an immutable artifact — a rebuilt release is now followed instead of failing the build. That is the intended behaviour here, since the rebuild breakage was the problem being solved and upstream is the same author. Tests updated in step: 12 suites asserted the literal MDPRESS_SHA256 as a proxy for "this download is checksum-verified". They now assert checksums.txt, which is where that guarantee lives.
This commit is contained in:
@@ -41,16 +41,23 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra poppler-utils
|
||||
|
||||
- name: Install mdPress 0.7.10
|
||||
env:
|
||||
MDPRESS_VERSION: "0.7.10"
|
||||
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
|
||||
- name: Resolve latest mdPress release
|
||||
run: |
|
||||
url="$(curl -fsSL --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/yeasy/mdPress/releases/latest)"
|
||||
version="${url##*/v}"
|
||||
test -n "$version" || { echo "could not resolve latest mdPress release"; exit 1; }
|
||||
echo "MDPRESS_VERSION=$version" >> "$GITHUB_ENV"
|
||||
echo "resolved mdPress $version"
|
||||
- name: Install mdPress (checksum-verified)
|
||||
run: |
|
||||
archive="$RUNNER_TEMP/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSL --retry 3 \
|
||||
"https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" \
|
||||
-o "$archive"
|
||||
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
|
||||
expected="$(curl -fsSL --retry 3 "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/checksums.txt" \
|
||||
| awk -v f="mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" '$2==f {print $1}')"
|
||||
test -n "$expected" || { echo "no published checksum for mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"; exit 1; }
|
||||
echo "${expected} $archive" | sha256sum -c -
|
||||
tar xzf "$archive" -C "$RUNNER_TEMP" mdpress
|
||||
mkdir -p "$RUNNER_TEMP/bin"
|
||||
install -m 0755 "$RUNNER_TEMP/mdpress" "$RUNNER_TEMP/bin/mdpress"
|
||||
|
||||
@@ -65,16 +65,23 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra poppler-utils
|
||||
|
||||
- name: Install mdPress 0.7.10
|
||||
env:
|
||||
MDPRESS_VERSION: "0.7.10"
|
||||
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
|
||||
- name: Resolve latest mdPress release
|
||||
run: |
|
||||
url="$(curl -fsSL --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/yeasy/mdPress/releases/latest)"
|
||||
version="${url##*/v}"
|
||||
test -n "$version" || { echo "could not resolve latest mdPress release"; exit 1; }
|
||||
echo "MDPRESS_VERSION=$version" >> "$GITHUB_ENV"
|
||||
echo "resolved mdPress $version"
|
||||
- name: Install mdPress (checksum-verified)
|
||||
run: |
|
||||
archive="$RUNNER_TEMP/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSL --retry 3 \
|
||||
"https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" \
|
||||
-o "$archive"
|
||||
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
|
||||
expected="$(curl -fsSL --retry 3 "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/checksums.txt" \
|
||||
| awk -v f="mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" '$2==f {print $1}')"
|
||||
test -n "$expected" || { echo "no published checksum for mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"; exit 1; }
|
||||
echo "${expected} $archive" | sha256sum -c -
|
||||
tar xzf "$archive" -C "$RUNNER_TEMP" mdpress
|
||||
mkdir -p "$RUNNER_TEMP/bin"
|
||||
install -m 0755 "$RUNNER_TEMP/mdpress" "$RUNNER_TEMP/bin/mdpress"
|
||||
|
||||
@@ -36,16 +36,23 @@ jobs:
|
||||
python3 check_project_rules.py
|
||||
npm test
|
||||
|
||||
- name: Install mdPress 0.7.10
|
||||
env:
|
||||
MDPRESS_VERSION: "0.7.10"
|
||||
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
|
||||
- name: Resolve latest mdPress release
|
||||
run: |
|
||||
url="$(curl -fsSL --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/yeasy/mdPress/releases/latest)"
|
||||
version="${url##*/v}"
|
||||
test -n "$version" || { echo "could not resolve latest mdPress release"; exit 1; }
|
||||
echo "MDPRESS_VERSION=$version" >> "$GITHUB_ENV"
|
||||
echo "resolved mdPress $version"
|
||||
- name: Install mdPress (checksum-verified)
|
||||
run: |
|
||||
archive="$RUNNER_TEMP/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSL --retry 3 \
|
||||
"https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" \
|
||||
-o "$archive"
|
||||
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
|
||||
expected="$(curl -fsSL --retry 3 "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/checksums.txt" \
|
||||
| awk -v f="mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" '$2==f {print $1}')"
|
||||
test -n "$expected" || { echo "no published checksum for mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"; exit 1; }
|
||||
echo "${expected} $archive" | sha256sum -c -
|
||||
tar xzf "$archive" -C "$RUNNER_TEMP" mdpress
|
||||
mkdir -p "$RUNNER_TEMP/bin"
|
||||
install -m 0755 "$RUNNER_TEMP/mdpress" "$RUNNER_TEMP/bin/mdpress"
|
||||
|
||||
@@ -44,16 +44,23 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra poppler-utils
|
||||
|
||||
- name: Install mdPress 0.7.10
|
||||
env:
|
||||
MDPRESS_VERSION: "0.7.10"
|
||||
MDPRESS_SHA256: "17e53e455996940bbbce64c69c43b3fb543f1501e03b74cf0434074efebd2db4"
|
||||
- name: Resolve latest mdPress release
|
||||
run: |
|
||||
url="$(curl -fsSL --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/yeasy/mdPress/releases/latest)"
|
||||
version="${url##*/v}"
|
||||
test -n "$version" || { echo "could not resolve latest mdPress release"; exit 1; }
|
||||
echo "MDPRESS_VERSION=$version" >> "$GITHUB_ENV"
|
||||
echo "resolved mdPress $version"
|
||||
- name: Install mdPress (checksum-verified)
|
||||
run: |
|
||||
archive="$RUNNER_TEMP/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSL --retry 3 \
|
||||
"https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" \
|
||||
-o "$archive"
|
||||
echo "${MDPRESS_SHA256} $archive" | sha256sum -c -
|
||||
expected="$(curl -fsSL --retry 3 "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/checksums.txt" \
|
||||
| awk -v f="mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" '$2==f {print $1}')"
|
||||
test -n "$expected" || { echo "no published checksum for mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"; exit 1; }
|
||||
echo "${expected} $archive" | sha256sum -c -
|
||||
tar xzf "$archive" -C "$RUNNER_TEMP" mdpress
|
||||
mkdir -p "$RUNNER_TEMP/bin"
|
||||
install -m 0755 "$RUNNER_TEMP/mdpress" "$RUNNER_TEMP/bin/mdpress"
|
||||
|
||||
Reference in New Issue
Block a user