Repository navigation
fix(distribution): regenerate the site download manifest on every deploy - #113
Merged
Merged
Conversation
docs/_data/downloads.json was committed by hand and the release pipeline only refreshed the copy in the tap repository, so the terminal installers' site fallback would keep installing 0.3.2 after the next release. Build and deploy the site from GitHub Actions instead of the legacy branch build. Before the Jekyll build, scripts/site-downloads.mjs reads the latest stable release and writes the manifest from the SHA-256 digests GitHub records for each asset. The workflow redeploys after the Release workflow finishes (workflow_run runs on master, which the github-pages environment requires) and checks that the rendered TSV lists every asset before publishing. The installers now read the site manifest first and fall back to the tap copy, since raw.githubusercontent.com is unreachable on some networks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
合并前先把仓库 Settings → Pages 的来源从 “Deploy from a branch” 改为 “GitHub Actions”。
先合并的话,传统构建读不到已移除的
docs/_data/downloads.json,会上线一份空的install/downloads.tsv;安装脚本现在优先读它,而 tap 的副本目前还是 404,终端安装会直接失败。先切换没有风险:线上官网保持现状,直到本工作流首次部署。问题
终端安装脚本的备用清单
install/downloads.tsv由手动提交的docs/_data/downloads.json渲染,distribute.yml只更新 tap 仓库的副本。发新版后,官网这份会一直指向 0.3.2:仍能安装,但版本是旧的,也没有任何提示。改动
scripts/site-downloads.mjs:读取releases/latest接口数据,用 GitHub 为每个附件记录的 SHA-256 生成docs/_data/downloads.json。生成规则沿用distribution.mjs的downloadManifest,格式与 tap 一致。附件不全、缺少 SHA-256,或者是草稿/测试版时报错。.github/workflows/pages.yml:官网改由 Actions 构建部署(jekyll-build-pages,与传统模式相同的 github-pages 环境)。docs/或生成脚本有改动推送到 master 时部署;PR 中只构建,不部署。Release工作流结束后,通过workflow_run重新部署(测试版标签跳过)。github-pages环境只允许从 master 部署,打标签触发的流水线不能直接部署;workflow_run总在默认分支上运行。docs/_data/downloads.json:从仓库移除,并加入.gitignore。raw.githubusercontent.com在部分网络下不可达,而且 tap 在下次发版前没有downloads.tsv,原来每次安装都会先失败一次。TECHNICAL.md、docs/_config.yml说明同步更新,新测试加入npm test。验证
npm test40 项通过。Pages工作流的构建任务(不部署),验证清单生成与 Jekyll 构建。合并后
https://bitdan.github.io/snap-desk/install/downloads.tsv、install.ps1.txt、install.sh均正常返回。Pages工作流由workflow_run触发,并更新到新版本。🤖 Generated with Claude Code