fix(deploy): re-point deploy pipeline + userscript URLs to Forgejo #1
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Контекст
После бана GitHub-аккаунта
slaid098userscriptopencode-voice-dictationсломан в двух местах:.github/workflows/deploy.yml): используетpeaceiris/actions-gh-pages@v4— стороннюю GitHub Action, которая не скачивается на Forgejo. Run #2 = failure. ВеткаdistНЕ существует на Forgejo.vite.config.ts):@updateURL,@downloadURL,@icon,@namespaceуказывают наraw.githubusercontent.com/slaid098/...(забанен). Существующие юзеры не получают авто-апдейт.Клон:
git clone https://slaid098:2cbcfa4b8f269bed7f1323b418cc7c11637f5cb7@git.slaid098.dev/slaid098/opencode-voice-dictation.git. Default branch:main.Плагин:
vite-plugin-monkey^5.0.0 — эмититdist/opencode-voice-dictation.user.js+dist/opencode-voice-dictation.meta.js.Forgejo raw формат (публичный, 200 без auth):
https://git.slaid098.dev/{owner}/{repo}/raw/branch/{branch}/{path}. Подтверждено live.secrets.GITHUB_TOKENдоступен на Forgejo сcontents: write(Gitea-совместимость).Задача
1.
vite.config.ts— 4 URL + version bumpnamespacehttps://github.com/slaid098/opencode-voice-dictationhttps://git.slaid098.dev/slaid098/opencode-voice-dictationversion1.0.51.0.6iconhttps://raw.githubusercontent.com/slaid098/opencode-voice-dictation/main/assets/icon.pnghttps://git.slaid098.dev/slaid098/opencode-voice-dictation/raw/branch/main/assets/icon.pngupdateURLhttps://raw.githubusercontent.com/.../dist/opencode-voice-dictation.meta.jshttps://git.slaid098.dev/slaid098/opencode-voice-dictation/raw/branch/dist/opencode-voice-dictation.meta.jsdownloadURLhttps://raw.githubusercontent.com/.../dist/opencode-voice-dictation.user.jshttps://git.slaid098.dev/slaid098/opencode-voice-dictation/raw/branch/dist/opencode-voice-dictation.user.js2.
package.json— version bumpСтрока 3:
"version": "1.0.5"→"1.0.6"(синхронно сvite.config.ts).3.
README.md— 2 install link (строки 43 EN, 107 RU)GitHub URL → Forgejo URL (
https://git.slaid098.dev/slaid098/opencode-voice-dictation/raw/branch/dist/opencode-voice-dictation.user.js). Добавить note: "Existing users with the legacy GitHub@updateURLneed a one-time manual reinstall from the Forgejo URL."4.
.github/workflows/deploy.yml— заменить peaceiris на git pushЗаменить шаг "Deploy to dist branch" на:
Добавить
workflow_dispatch:вon:block.5. Доксы — mirror-agnostic (НЕ хардкодить URL, ссылаться на vite.config.ts)
AGENTS.md (строка 20, "Dist deploy"):
peaceiris/actions-gh-pages@v4→git push to dist — orphan + force, no third-party actionraw files on the dist branch→raw files on the dist branch — see vite.config.ts for the exact URLs (source of truth)@updateURLfrom a previous host need a one-time manual reinstall."docs/project-map/assets.md (строки 13, 17):
путь main/assets/icon.png→Forgejo raw-URL (see vite.config.ts @icon)(raw-URL)→(Forgejo raw-URL, see vite.config.ts)Контракты
vite.config.ts— единственное место с полным canonical URL (source of truth). Доксы ссылаются на него, не дублируют URL (mirror-agnostic — репо будет зеркалироваться).vite.config.ts+package.json=1.0.6.deploy.ymlне использует сторонних actions (толькоactions/checkout,actions/setup-node,run:).distbranch создаётся автоматически (orphan + force push)./raw/branch/{branch}/{path}.Инварианты
npm run build→dist/opencode-voice-dictation.user.js+dist/opencode-voice-dictation.meta.js(имена не меняются).@versionв собранном.user.js=1.0.6.ci.yml) зелёный: lint, typecheck, knip, test.deploy.yml) после merge → success,distсоздан, оба файла доступны по Forgejo raw URL (public, 200).Граничные случаи
distне существует →--orphan+--force. Последующие:--forceперезаписывает (wipe + replace).actions/checkout@v7persist-credentials: используем явный URL с${GITHUB_TOKEN}для надёжности.@updateURL: one-time manual reinstall (auto-update не дойдёт).@namespace— не fetchable URL (uniqueness key), но репоинт для консистентности.Влияние на связанные компоненты
deploy.yml:peaceiris→git push.distbranch появляется на Forgejo.vite.config.ts: 4 URL + version.vite-plugin-monkeyинжектит их в==UserScript==header.README.md: install links → Forgejo.AGENTS.md/docs/project-map/assets.md: mirror-agnostic (ссылка наvite.config.ts).Вне scope
docs/decisions/иdocs/handoff/(исторические ADR).ci.yml..github/dependabot.yml.Критерии приемки
vite.config.ts: 4 URL →git.slaid098.dev/.../raw/branch/...,version: "1.0.6".package.json:"version": "1.0.6".README.md(EN+RU): install links → Forgejo, note про one-time reinstall.deploy.yml:peaceirisудалён,git push --force(orphan),workflow_dispatch:добавлен.AGENTS.md"Dist deploy":peaceirisубран, ссылка наvite.config.tsкак source of truth.docs/project-map/assets.md: строки 13, 17 ссылаются наvite.config.ts.ci.yml) зелёный.deploy.yml) success после merge:distсоздан,curl -o /dev/null -w "%{http_code}" ".../raw/branch/dist/opencode-voice-dictation.user.js"→200.