Skip to content

Commit c060306

Browse files
authored
Merge pull request #2131 from Websoft9/feature/appstore-publish-migration
update
2 parents 210ef6e + b68099f commit c060306

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/appstore-publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
aws s3 sync \
140140
dist/appstore-publish/appstore/${{ steps.resolve_channel.outputs.channel }}/catalog \
141141
s3://artifact/appstore/${{ steps.resolve_channel.outputs.channel }}/catalog \
142+
--cache-control "public, max-age=60" \
142143
--endpoint-url "$AWS_ENDPOINT_URL"
143144
144145
- name: Upload v2 library metadata to Cloudflare R2
@@ -151,6 +152,7 @@ jobs:
151152
dist/appstore-publish/appstore/${{ steps.resolve_channel.outputs.channel }}/library \
152153
s3://artifact/appstore/${{ steps.resolve_channel.outputs.channel }}/library \
153154
--exclude "apps/*" \
155+
--cache-control "public, max-age=60" \
154156
--endpoint-url "$AWS_ENDPOINT_URL"
155157
156158
- name: Upload v2 per-app packages to Cloudflare R2 (additive only)
@@ -163,6 +165,7 @@ jobs:
163165
aws s3 cp --recursive \
164166
dist/appstore-publish/appstore/${{ steps.resolve_channel.outputs.channel }}/library/apps \
165167
s3://artifact/appstore/${{ steps.resolve_channel.outputs.channel }}/library/apps \
168+
--cache-control "public, max-age=60" \
166169
--endpoint-url "$AWS_ENDPOINT_URL"
167170
fi
168171
@@ -175,6 +178,7 @@ jobs:
175178
aws s3 sync \
176179
dist/appstore-publish/appstore/${{ steps.resolve_channel.outputs.channel }}/manifests \
177180
s3://artifact/appstore/${{ steps.resolve_channel.outputs.channel }}/manifests \
181+
--cache-control "public, max-age=60" \
178182
--endpoint-url "$AWS_ENDPOINT_URL"
179183
180184
# ── legacy uploads (old R2 paths, kept for backward compatibility) ──
@@ -207,7 +211,7 @@ jobs:
207211
if [[ "${{ steps.resolve_channel.outputs.channel }}" == "dev" ]]; then
208212
echo "urls=[\"https://artifact.websoft9.com/dev/websoft9/plugin/library/library-dev.zip\",\"https://artifact.websoft9.com/dev/websoft9/plugin/media/media-dev.zip\"]" >> "$GITHUB_OUTPUT"
209213
else
210-
echo "urls=[\"https://artifact.websoft9.com/release/websoft9/plugin/library/library-latest.zip\",\"https://artifact.websoft9.com/release/websoft9/plugin/media/media.zip\"]" >> "$GITHUB_OUTPUT"
214+
echo "urls=[\"https://artifact.websoft9.com/release/websoft9/plugin/library/library-latest.zip\",\"https://artifact.websoft9.com/release/websoft9/plugin/media/media-latest.zip\"]" >> "$GITHUB_OUTPUT"
211215
fi
212216
213217
- name: Purge legacy Cloudflare Cache

build/library_publish.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def build_legacy_library_artifacts(output_dir: Path, package_name: str, packaged
492492

493493
def build_legacy_media_artifacts(output_dir: Path, catalog_source_dir: Path, channel: str) -> dict:
494494
output_dir.mkdir(parents=True, exist_ok=True)
495-
archive_name = "media-dev.zip" if channel == "dev" else "media.zip"
495+
archive_name = "media-dev.zip" if channel == "dev" else "media-latest.zip"
496496
distribution_map = build_distribution_map() if channel == "dev" else {}
497497

498498
with tempfile.TemporaryDirectory() as tmp_dir_name:

docs/appstore-release-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ schemaVersion 不在本地支持列表中:
400400
| `appstore-manifest.json` | Cache-Control: 60s | 入口文件,需及时感知更新 |
401401
| `catalog/manifest.json` | Cache-Control: 60s | 体积极小,变更频率低 |
402402
| `apps-delta-*.json` | Cache-Control: 60s | 体积极小 |
403-
| `apps/{app}/latest.zip` | Cache-Control: 86400 | 未变更时 hash 不变,可大胆缓存 |
403+
| `apps/{app}/latest.zip` | Cache-Control: 60s | 模板文件体积极小,变更后需立即生效 |
404404
| `full/library-{dsv}.zip` | immutable | 文件名含内容版本,永不变 |
405405
| `*.sha256` | 跟随对应文件 | 校验与被校验文件同步缓存 |
406406
| `catalog_*.json / product_*.json` | Cache-Control: 3600 | 描述数据,变更频率中等 |

0 commit comments

Comments
 (0)