From 823de207617637b7520443f4d19939235d1abbb1 Mon Sep 17 00:00:00 2001 From: tiye Date: Fri, 2 Oct 2026 05:40:15 +0800 Subject: [PATCH] Use released COS verification and default Calcit build --- .github/workflows/upload.yaml | 14 +++++++++----- README.md | 12 +++++++++--- package.json | 5 +++++ vite.config.mjs | 3 +++ 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 vite.config.mjs diff --git a/.github/workflows/upload.yaml b/.github/workflows/upload.yaml index 4f5ef47..2c040d3 100644 --- a/.github/workflows/upload.yaml +++ b/.github/workflows/upload.yaml @@ -10,8 +10,9 @@ permissions: contents: read concurrency: - group: cos-upload-${{ github.repository }}-${{ github.event_name == 'pull_request' && github.run_id || 'production' }} + group: cos-upload-${{ github.repository }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'production' }} cancel-in-progress: false + queue: max jobs: test: @@ -42,6 +43,7 @@ jobs: set -euo pipefail caps --ci --strict yarn install --immutable + caps verify --toolchain - name: Validate Calcit snapshot run: | @@ -53,6 +55,9 @@ jobs: calcit calcit.cirru edit format git diff --exit-code -- calcit.cirru calcit calcit.cirru --check-only + calcit calcit.cirru analyze check-public \ + --ns app.comp.container --ns app.config --ns app.main \ + --ns app.schema --ns app.updater --summary-only --format json - name: Build client with CDN asset URLs id: asset-path @@ -62,7 +67,7 @@ jobs: run: | set -euo pipefail if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then - asset_prefix="${GITHUB_REPOSITORY}/pr/${PR_NUMBER}/${GITHUB_RUN_ID}/" + asset_prefix="${GITHUB_REPOSITORY}/pr/${PR_NUMBER}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/" else asset_prefix="${GITHUB_REPOSITORY}/" fi @@ -70,13 +75,12 @@ jobs: echo "VITE_BASE_URL=${VITE_BASE_URL}" >> "$GITHUB_ENV" echo "prefix=${asset_prefix}" >> "$GITHUB_OUTPUT" echo "base-url=${VITE_BASE_URL}" >> "$GITHUB_OUTPUT" - calcit calcit.cirru js + yarn build node --test scripts/upgrade.test.mjs - yarn vite build --base="$VITE_BASE_URL" - name: Upload static assets to COS if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - uses: worktools/cos-upload-action@17e6d213fe9f6772a6090a13c8ba044cd6cbcb09 # v1.1.1 + uses: worktools/cos-upload-action@06d6027dcca6413c5936e04a9b6e9f0d5ef71ba0 # v1.2.0 with: source-dir: dist bucket: ${{ secrets.COS_BUCKET }} diff --git a/README.md b/README.md index 3ed8ba1..f0e3ffa 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,17 @@ Use Calcit 0.27.0 and the canonical `calcit.cirru` / `deps.cirru` files. Retired `compact.cirru` and `package.cirru` snapshots are ignored and rejected by CI. Dependencies are resolved with `caps --ci --strict`. -The COS action verifies uploaded resources with its built-in verify settings; +Released COS action v1.2.0 validates HTML references and verifies public uploads; no extra CDN checker is needed. Existing external fonts and server paths remain unchanged. -Each PR run uses its own preview prefix (`pr///`) and concurrency -group. The six runtime checks do not claim to validate generated CDN URLs. +Each PR run uses its own preview prefix (`pr////`). +Runs queue per PR and separately for production, without cancelling uploads. +The six existing runtime checks cover diff behavior, not CDN verification. + +`yarn build` compiles the default JS browser entry and builds once, using +`VITE_BASE_URL` when set. `yarn dev` compiles initially and starts Vite; run +`calcit calcit.cirru -w` in another terminal for live edits. CI keeps canonical, +entry/all-public checks, toolchain verification and the existing business tests. ### Workflow diff --git a/package.json b/package.json index c8dfab0..27d331c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,11 @@ "author": "jiyinyiyong", "license": "MIT", "packageManager": "yarn@4.18.0", + "scripts": { + "compile": "calcit calcit.cirru", + "build": "yarn compile && vite build", + "dev": "yarn compile && vite" + }, "devDependencies": { "bottom-tip": "^0.1.5", "vite": "8.3.1" diff --git a/vite.config.mjs b/vite.config.mjs new file mode 100644 index 0000000..8354020 --- /dev/null +++ b/vite.config.mjs @@ -0,0 +1,3 @@ +export default { + base: process.env.VITE_BASE_URL ?? "./", +};