Remove one-time v17.6.9 release workflow
This commit is contained in:
parent
48d1f3309b
commit
40ecd73f1c
112
.github/workflows/prepare-v1769.yml
vendored
112
.github/workflows/prepare-v1769.yml
vendored
@ -1,112 +0,0 @@
|
||||
name: Prepare v17.6.9 release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature/v17.6.9-offer-pdf-tabs-gallery
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
prepare:
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: feature/v17.6.9-offer-pdf-tabs-gallery
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Update release files
|
||||
shell: bash
|
||||
run: |
|
||||
python - <<'PY'
|
||||
from pathlib import Path
|
||||
import json
|
||||
old='20260908-v17-6-8-developer-console-ux'
|
||||
new='20260908-v17-6-9-offer-pdf-tabs-gallery'
|
||||
old_cache='sun-catering-pwa-v73-20260908-v17-6-8-developer-console-ux'
|
||||
new_cache='sun-catering-pwa-v74-20260908-v17-6-9-offer-pdf-tabs-gallery'
|
||||
|
||||
p=Path('public/core/performance.js')
|
||||
s=p.read_text()
|
||||
s=s.replace("const VERSION='17.6.8';","const VERSION='17.6.9';",1)
|
||||
s=s.replace(f"const RELEASE='{old}';",f"const RELEASE='{new}';",1)
|
||||
loader=""" function loadOfferWorkspace(){\n if(window.SunOfferWorkspaceV1769||document.getElementById('sunOfferWorkspaceV1769Script'))return;\n const script=document.createElement('script');script.id='sunOfferWorkspaceV1769Script';script.src=`core/offer-workspace-v1769.js?v=${RELEASE}`;script.async=true;script.onerror=()=>console.error('[Caterium] Не загрузился модуль offer-workspace-v1769.js');document.head.appendChild(script);\n }\n"""
|
||||
if 'function loadOfferWorkspace()' not in s:
|
||||
s=s.replace(' const start=()=>{',loader+' const start=()=>{',1)
|
||||
s=s.replace('loadHotfix();loadOpsUX();loadUXFix();loadDeveloperUX();scan(document);startMemoryTimer();','loadHotfix();loadOpsUX();loadUXFix();loadDeveloperUX();loadOfferWorkspace();scan(document);startMemoryTimer();',1)
|
||||
s=s.replace('loadHotfix,loadOpsUX,loadUXFix,loadDeveloperUX,disconnect:','loadHotfix,loadOpsUX,loadUXFix,loadDeveloperUX,loadOfferWorkspace,disconnect:',1)
|
||||
p.write_text(s)
|
||||
|
||||
p=Path('public/service-worker.js')
|
||||
s=p.read_text().replace(old_cache,new_cache).replace(f"const VERSION='{old}';",f"const VERSION='{new}';")
|
||||
needle='`./core/developer-console-v1768.js?v=${VERSION}`'
|
||||
if 'offer-workspace-v1769.js' not in s:
|
||||
s=s.replace(needle,needle+',`./core/offer-workspace-v1769.js?v=${VERSION}`',1)
|
||||
p.write_text(s)
|
||||
|
||||
p=Path('public/index.html')
|
||||
p.write_text(p.read_text().replace(old,new))
|
||||
|
||||
p=Path('package.json')
|
||||
pkg=json.loads(p.read_text())
|
||||
pkg['version']='17.6.9'
|
||||
check=pkg['scripts']['check:syntax']
|
||||
add='node --check public/core/offer-workspace-v1769.js'
|
||||
if add not in check:
|
||||
pkg['scripts']['check:syntax']=check+' && '+add
|
||||
p.write_text(json.dumps(pkg,ensure_ascii=False,indent=2)+'\n')
|
||||
|
||||
p=Path('docs/release-manifest.json')
|
||||
m=json.loads(p.read_text())
|
||||
m['version']='v17.6.9'
|
||||
m['pwaCache']='v74-20260908-v17-6-9-offer-pdf-tabs-gallery'
|
||||
m['release']=new
|
||||
m['notes']='Client offer workspace: PDF preview, editor and PDF templates separated into tabs; editor scroll restored; two per-offer final gallery photos can be uploaded and are used in preview/PDF.'
|
||||
m['offerWorkspaceTabs']=True
|
||||
m['offerTemplatesSeparateTab']=True
|
||||
m['offerEditorScrollable']=True
|
||||
m['offerTwoCustomGalleryPhotos']=True
|
||||
m['offerWorkspaceModule']='core/offer-workspace-v1769.js'
|
||||
p.write_text(json.dumps(m,ensure_ascii=False,indent=2)+'\n')
|
||||
|
||||
p=Path('tests/static-security.mjs')
|
||||
s=p.read_text()
|
||||
s=s.replace("developerUX=readPub('core/developer-console-v1768.js');","developerUX=readPub('core/developer-console-v1768.js'),offerWorkspace=readPub('core/offer-workspace-v1769.js');",1)
|
||||
s=s.replace("if(!sw.includes('v17-6-8-developer-console-ux')||!sw.includes('developer-console-v1768.js')||!sw.includes('classic-offer-pdf-v1767.js')||sw.includes('offer-gallery-data.js'))fail('service worker cache is stale');else ok('PWA cache updated to v17.6.8');", "if(!sw.includes('v17-6-9-offer-pdf-tabs-gallery')||!sw.includes('offer-workspace-v1769.js')||!sw.includes('developer-console-v1768.js')||!sw.includes('classic-offer-pdf-v1767.js')||sw.includes('offer-gallery-data.js'))fail('service worker cache is stale');else ok('PWA cache updated to v17.6.9');",1)
|
||||
s=s.replace("if(html.includes('20260907-v17-6-0-stability-security')||!html.includes('20260908-v17-6-8-developer-console-ux')||!html.includes('classic-offer-pdf-v1767.js'))fail('index still serves stale core asset version');else ok('index cache-busting is current');", "if(html.includes('20260907-v17-6-0-stability-security')||!html.includes('20260908-v17-6-9-offer-pdf-tabs-gallery')||!html.includes('classic-offer-pdf-v1767.js'))fail('index still serves stale core asset version');else ok('index cache-busting is current');",1)
|
||||
marker="if(/service_role\\s*[:=]\\s*['\"][A-Za-z0-9._-]{20,}/i.test(ops+hotfix+ux+classic+developerUX)||/eyJ[a-zA-Z0-9_-]{30,}/.test(ops+hotfix+ux+classic+developerUX))fail('possible secret in ops/hotfix/ux/classic/developer module');else ok('ops/hotfix/ux/classic/developer modules have no hard-coded secret');"
|
||||
replacement="if(!offerWorkspace.includes(\"const VERSION='17.6.9'\")||!offerWorkspace.includes('data-offer-workspace-tab=\\\"templates\\\"')||!offerWorkspace.includes('data-offer-gallery-slot')||!offerWorkspace.includes('sunOfferGalleryOverridesV1769'))fail('v17.6.9 offer workspace module missing');else ok('v17.6.9 offer workspace module present');\nif(/service_role\\s*[:=]\\s*['\"][A-Za-z0-9._-]{20,}/i.test(ops+hotfix+ux+classic+developerUX+offerWorkspace)||/eyJ[a-zA-Z0-9_-]{30,}/.test(ops+hotfix+ux+classic+developerUX+offerWorkspace))fail('possible secret in ops/hotfix/ux/classic/developer/offer module');else ok('ops/hotfix/ux/classic/developer/offer modules have no hard-coded secret');"
|
||||
s=s.replace(marker,replacement,1)
|
||||
p.write_text(s)
|
||||
|
||||
p=Path('tests/release-check.mjs')
|
||||
s=p.read_text()
|
||||
s=s.replace("developerUX=read('core/developer-console-v1768.js');","developerUX=read('core/developer-console-v1768.js'),offerWorkspace=read('core/offer-workspace-v1769.js');",1)
|
||||
s=s.replace("check(sw.includes('v73-20260908-v17-6-8-developer-console-ux')&&sw.includes('classic-offer-pdf-v1767.js')&&sw.includes('developer-console-v1768.js'),'service worker cache is v17.6.8');","check(sw.includes('v74-20260908-v17-6-9-offer-pdf-tabs-gallery')&&sw.includes('classic-offer-pdf-v1767.js')&&sw.includes('developer-console-v1768.js')&&sw.includes('offer-workspace-v1769.js'),'service worker cache is v17.6.9');",1)
|
||||
s=s.replace("check(index.includes('20260908-v17-6-8-developer-console-ux')&&index.includes('classic-offer-pdf-v1767.js')&&!index.includes('20260907-v17-6-0-stability-security'),'index cache-busting points to v17.6.8');","check(index.includes('20260908-v17-6-9-offer-pdf-tabs-gallery')&&index.includes('classic-offer-pdf-v1767.js')&&!index.includes('20260907-v17-6-0-stability-security'),'index cache-busting points to v17.6.9');",1)
|
||||
s=s.replace("check(String(releaseManifest.pwaCache||'').includes('v73-20260908-v17-6-8-developer-console-ux'),'release manifest points to current PWA cache');","check(String(releaseManifest.pwaCache||'').includes('v74-20260908-v17-6-9-offer-pdf-tabs-gallery'),'release manifest points to current PWA cache');",1)
|
||||
s=s.replace("['17.6.2','17.6.3','17.6.4','17.6.5','17.6.6','17.6.7','17.6.8']","['17.6.2','17.6.3','17.6.4','17.6.5','17.6.6','17.6.7','17.6.8','17.6.9']",1)
|
||||
s=s.replace("release notes exist through v17.6.8","release notes exist through v17.6.9",1)
|
||||
s=s.replace("check(pkg.version==='17.6.8','package version is v17.6.8');","check(pkg.version==='17.6.9','package version is v17.6.9');",1)
|
||||
insert="""check(offerWorkspace.includes(\"const VERSION='17.6.9'\")&&offerWorkspace.includes('sun-offer-workspace-tabs-v1769'),'offer workspace v17.6.9 is versioned');\ncheck(offerWorkspace.includes('PDF и предпросмотр')&&offerWorkspace.includes('Оформление PDF')&&offerWorkspace.includes('data-offer-gallery-slot'),'offer workspace separates preview/editor/templates and exposes two gallery uploads');\ncheck(offerWorkspace.includes('SunClassicOfferPDFV1767')&&offerWorkspace.includes('finalGallery=galleryFor'),'custom gallery is injected into PDF renderer');\ncheck(releaseManifest.offerWorkspaceTabs===true&&releaseManifest.offerTemplatesSeparateTab===true&&releaseManifest.offerTwoCustomGalleryPhotos===true,'release manifest records offer workspace changes');\n"""
|
||||
s=s.replace('if(bad)process.exit(1);',insert+'if(bad)process.exit(1);',1)
|
||||
p.write_text(s)
|
||||
|
||||
p=Path('tests/app.spec.mjs')
|
||||
s=p.read_text().replace("expect(result.version).toBe('17.6.8');","expect(result.version).toBe('17.6.9');",1)
|
||||
if "v17.6.9 offer workspace module boots" not in s:
|
||||
s += """\n\ntest('v17.6.9 offer workspace module boots', async ({ page }) => {\n await page.goto('/index.html',{waitUntil:'domcontentloaded'});\n const source=fs.readFileSync(path.join(process.cwd(),'public','core','offer-workspace-v1769.js'),'utf8');\n await page.evaluate(()=>{\n document.body.innerHTML='<div id=\"sunClientOfferModal\" class=\"modal on\"><div class=\"dialog\"><div class=\"sun-offer-modal-head\"><button id=\"sunOfferPdf\">Скачать PDF</button><button id=\"sunOfferEdit\">Редактировать</button></div><section id=\"sunOfferEditor\"><div class=\"sun-offer-editor-gallery\"><div class=\"sun-offer-editor-gallery-images\"><img src=\"offer-gallery/001.jpg\"><img src=\"offer-gallery/002.jpg\"></div></div></section><section id=\"sunOfferTemplateV1764\"></section><div class=\"sun-offer-frame-wrap\"><div id=\"sunClientOfferPreview\"></div></div></div></div>';\n window.sunOpenClientOffer=async()=>true;window.sunOpenCurrentClientOffer=async()=>true;\n window.SunClassicOfferPDFV1767={renderPages:async()=>[]};window.SunEnterprise={toast:()=>null};\n });\n await page.addScriptTag({content:source});\n await page.waitForFunction(()=>Boolean(window.SunOfferWorkspaceV1769),null,{timeout:5000});\n const result=await page.evaluate(()=>window.SunOfferWorkspaceV1769.checks());\n expect(result.version).toBe('17.6.9');\n expect(result.tabs).toBe(true);\n expect(await page.locator('[data-offer-gallery-slot]').count()).toBe(2);\n});\n"""
|
||||
p.write_text(s)
|
||||
|
||||
Path('docs/releases/V17.6.9-CHANGES.txt').write_text('''Caterium v17.6.9 — Client Offer PDF Workspace\n\n- Оформление PDF вынесено из верхней части предложения в отдельную вкладку «Оформление PDF».\n- Вкладка «PDF и предпросмотр» показывает только страницы предложения и кнопку скачивания, без редактора и длинной сетки шаблонов.\n- «Редактор» получил собственную прокручиваемую область, поэтому длинные настройки больше не блокируют скролл.\n- В редактор добавлены два независимых поля загрузки финальных фотографий «Как это выглядит на вашем столе».\n- Фотографии оптимизируются в браузере, сохраняются отдельно для предложения и подставляются в предпросмотр и скачиваемый PDF.\n- Кнопка «Сбросить» возвращает стандартную фотографию для каждого слота.\n''')
|
||||
PY
|
||||
npm install --package-lock-only
|
||||
- name: Commit release preparation
|
||||
shell: bash
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add public package.json package-lock.json docs tests
|
||||
git commit -m "Prepare Caterium v17.6.9 offer PDF workspace"
|
||||
git push origin HEAD:feature/v17.6.9-offer-pdf-tabs-gallery
|
||||
Loading…
Reference in New Issue
Block a user