2 Commits
Author SHA1 Message Date
poli0981 c133a00dc7 Merge pull request 'fix(publish-r2): name the rclone pins so rclone does not read them' (#7) from fix/publish-r2-rclone-env into main
Ops lint / actionlint + Python (push) Successful in 7s
Reviewed-on: #7
2026-11-24 16:23:15 +00:00
poli0981andClaude Opus 5.5 a3660e46d8 fix(publish-r2): name the rclone pins so rclone does not read them
Ops lint / actionlint + Python (pull_request) Successful in 6s
rclone reads every RCLONE_<FLAG> environment variable as that flag. The
job's pin RCLONE_VERSION=v1.76.0 therefore became --version, and the
install step's `rclone version` stopped with "CRITICAL: Invalid value
when setting --version from environment variable RCLONE_VERSION" before
anything was uploaded (free-steam-games-list android-v2.6.0,
2026-11-24). Every caller at v2026.11.3 fails the same way.

The three pins are PINNED_RCLONE_VERSION, _SHA256_WINDOWS and
_SHA256_LINUX; the runbook (§4.4) says why no other variable may start
with RCLONE_.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:01:12 +07:00
2 changed files with 14 additions and 9 deletions

No files matched your search

+13 -9
View File
@@ -103,9 +103,13 @@ jobs:
R2_BUCKET: poli0981-releases
PUBLIC_BASE: https://releases.poli0981.dev
ARTIFACT_DIR: _r2
RCLONE_VERSION: v1.76.0
RCLONE_SHA256_WINDOWS: 8b4fd2737ade4e70c057ef4a49deb7cffe94b0fb9d7587c189d149823f21a1dc # rclone-v1.76.0-windows-amd64.zip
RCLONE_SHA256_LINUX: b00f00b3266c3764413afe599d3ec316f6f43b3e0ea8a0bc1d186d2133e46df7 # rclone-v1.76.0-linux-amd64.zip
# Never name these RCLONE_*: rclone reads every RCLONE_<FLAG> variable as
# that flag, and RCLONE_VERSION made `rclone version` die with "Invalid
# value when setting --version from environment variable" (v2026.11.3,
# free-steam-games-list android-v2.6.0: nothing was uploaded).
PINNED_RCLONE_VERSION: v1.76.0
PINNED_RCLONE_SHA256_WINDOWS: 8b4fd2737ade4e70c057ef4a49deb7cffe94b0fb9d7587c189d149823f21a1dc # rclone-v1.76.0-windows-amd64.zip
PINNED_RCLONE_SHA256_LINUX: b00f00b3266c3764413afe599d3ec316f6f43b3e0ea8a0bc1d186d2133e46df7 # rclone-v1.76.0-linux-amd64.zip
# rclone remote "r2" — env-only config, same scheme as the server backup script.
# The access keys are added only on the upload steps.
RCLONE_CONFIG_R2_TYPE: s3
@@ -163,11 +167,11 @@ jobs:
Write-Host "Feed files ($($feeds.Count)) -> uploaded last: $($seen.Keys -join ', ')"
$tmp = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { [IO.Path]::GetTempPath() }
$pkg = "rclone-$($env:RCLONE_VERSION)-windows-amd64"
$pkg = "rclone-$($env:PINNED_RCLONE_VERSION)-windows-amd64"
$zip = Join-Path $tmp "$pkg.zip"
Invoke-WebRequest -UseBasicParsing -Uri "https://downloads.rclone.org/$($env:RCLONE_VERSION)/$pkg.zip" -OutFile $zip
Invoke-WebRequest -UseBasicParsing -Uri "https://downloads.rclone.org/$($env:PINNED_RCLONE_VERSION)/$pkg.zip" -OutFile $zip
$hash = (Get-FileHash -Algorithm SHA256 -LiteralPath $zip).Hash.ToLowerInvariant()
if ($hash -ne $env:RCLONE_SHA256_WINDOWS) { Fail "rclone checksum mismatch: $hash" }
if ($hash -ne $env:PINNED_RCLONE_SHA256_WINDOWS) { Fail "rclone checksum mismatch: $hash" }
$dest = Join-Path $tmp 'rclone'
Expand-Archive -LiteralPath $zip -DestinationPath $dest -Force
$bin = Join-Path $dest $pkg
@@ -266,9 +270,9 @@ jobs:
echo "Feed files ($nfeeds) -> uploaded last: ${!seen[*]}"
tmp="${RUNNER_TEMP:-/tmp}"
pkg="rclone-${RCLONE_VERSION}-linux-amd64"
curl -fsSL --retry 3 -o "$tmp/$pkg.zip" "https://downloads.rclone.org/${RCLONE_VERSION}/$pkg.zip"
echo "${RCLONE_SHA256_LINUX} $tmp/$pkg.zip" | sha256sum -c -
pkg="rclone-${PINNED_RCLONE_VERSION}-linux-amd64"
curl -fsSL --retry 3 -o "$tmp/$pkg.zip" "https://downloads.rclone.org/${PINNED_RCLONE_VERSION}/$pkg.zip"
echo "${PINNED_RCLONE_SHA256_LINUX} $tmp/$pkg.zip" | sha256sum -c -
if command -v unzip >/dev/null 2>&1; then
unzip -q -o "$tmp/$pkg.zip" -d "$tmp"
else
+1
View File
@@ -343,6 +343,7 @@ For uploads that are not done by `vpk` (Tauri, extension zips, other files).
- Secrets: `R2_RELEASES_ACCESS_KEY_ID`, `R2_RELEASES_SECRET_ACCESS_KEY`. Variable: `R2_ACCOUNT_ID`.
- Tool: rclone (pinned version, checksum verified), configured only through env vars, as in the server backup script:
`RCLONE_CONFIG_R2_TYPE=s3`, `RCLONE_CONFIG_R2_PROVIDER=Cloudflare`, `RCLONE_CONFIG_R2_ENDPOINT=https://<account>.r2.cloudflarestorage.com`, `RCLONE_CONFIG_R2_REGION=auto`, `RCLONE_CONFIG_R2_NO_CHECK_BUCKET=true`, keys from secrets.
No other variable may start with `RCLONE_`: rclone reads every `RCLONE_<FLAG>` as that flag, and the pin `RCLONE_VERSION` broke `rclone version` in v2026.11.3, before anything was uploaded. The pins are `PINNED_RCLONE_*` since v2026.11.4.
- Steps: `rclone copy <versioned-dir> r2:poli0981-releases/<app>/` (never `sync`, never `delete`), then `rclone copyto` each feed file, then `curl -fsSI https://releases.poli0981.dev/<app>/<feed>` as a smoke test.
- Runs on any tag (`refs/tags/*`, push or dispatch), not only `v*`: free-steam-games-list releases its apps from `desktop-v*` and `android-v*` tags (ops v2026.11.3). Feeds land at `<app>/<file name>`, so two feeds of one app need two names (`latest.json`, `android-latest.json`).
- Permissions: `contents: read` only.