From a4b4d90ff25a886fb4b3260f3a5a06e0f0252d19 Mon Sep 17 00:00:00 2001 From: istarkov Date: Fri, 19 Apr 2024 22:15:56 +0300 Subject: [PATCH 1/6] Empty-Commit From 823842c3fb1f47091ffb14beea1f8e80247ca70b Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 20 Apr 2024 13:44:54 +0300 Subject: [PATCH 2/6] Fix naming --- .github/workflows/cli-r2.yaml | 42 ++++++++++++++--------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cli-r2.yaml b/.github/workflows/cli-r2.yaml index ee5e6025319a..42ad32215678 100644 --- a/.github/workflows/cli-r2.yaml +++ b/.github/workflows/cli-r2.yaml @@ -41,43 +41,35 @@ jobs: run: pnpm install --ignore-scripts - name: pnpm build - run: pnpm --filter 'webstudio-cloudlfare-template^...' run build + run: pnpm --filter 'webstudio-cloudflare-template^...' run build # Ideally, execute 'pnpm deploy --prod', but @remix-run/dev doesn't support this flag. # Despite being listed as a dependency, @remix-run/dev does not install the remix cli. # TODO: Minimize artefact size due to frequent downloads on each publish. - name: pnpm deploy - run: pnpm --filter 'webstudio-cloudlfare-template' deploy "${{ github.workspace }}/../cloudlfare-template" + run: pnpm --filter 'webstudio-cloudflare-template' deploy "${{ github.workspace }}/../cloudflare-template" - name: Make archive run: | - tar --use-compress-program="zstd -19" -cf cloudlfare-template.tar.zst cloudlfare-template + tar --use-compress-program="zstd -19" -cf cloudflare-template.tar.zst cloudflare-template working-directory: ${{ github.workspace }}/.. - name: Copy artifact run: | - curl https://rclone.org/install.sh | sudo bash - - ls -la - # For staging - rclone copyto -P -M \ - --no-check-dest \ - cloudlfare-template.tar.zst "r2:/${ARTEFACT_BUCKET_NAME}/public/cloudlfare-template/${{ github.ref_name }}.tar.zst" + aws s3 cp cloudflare-template.tar.zst "s3:/${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.ref_name }}.tar.zst" - # For production - rclone copyto -P -M \ - --no-check-dest \ - cloudlfare-template.tar.zst "r2:/${ARTEFACT_BUCKET_NAME}/public/cloudlfare-template/${{ github.sha }}.tar.zst" + # For production can be cached forever + aws s3 cp \ + --metadata-directive REPLACE --cache-control "public,max-age=31536102,immutable" \ + cloudflare-template.tar.zst "s3:/${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.sha }}.tar.zst" working-directory: ${{ github.workspace }}/.. env: - RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }} - RCLONE_CONFIG_R2_ACL: ${{ secrets.RCLONE_CONFIG_R2_ACL }} - RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }} - RCLONE_CONFIG_R2_PROVIDER: ${{ secrets.RCLONE_CONFIG_R2_PROVIDER }} - RCLONE_CONFIG_R2_TYPE: ${{ secrets.RCLONE_CONFIG_R2_TYPE }} - RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }} + AWS_ENDPOINT_URL_S3: ${{ secrets.AWS_ENDPOINT_URL_S3 }} + AWS_REGION: ${{ secrets.AWS_REGION }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} ARTEFACT_BUCKET_NAME: ${{ secrets.ARTEFACT_BUCKET_NAME }} checks: @@ -98,18 +90,18 @@ jobs: node-version: "18.x" - name: Copy atrifact via http - run: curl -o cloudlfare-template.tar.zst ${{ secrets.ARTEFACT_BUCKET_URL }}/public/cloudlfare-template/${{ github.ref_name }}.tar.zst + run: curl -o cloudflare-template.tar.zst ${{ secrets.ARTEFACT_BUCKET_URL }}/public/cloudflare-template/${{ github.ref_name }}.tar.zst - name: Extract archive - run: tar --use-compress-program="zstd -d" -xf cloudlfare-template.tar.zst -C . + run: tar --use-compress-program="zstd -d" -xf cloudflare-template.tar.zst -C . - name: Webstudio Build run: pnpm webstudio build --template internal --template saas-helpers --template cloudflare --assets false - working-directory: ${{ github.workspace }}/cloudlfare-template + working-directory: ${{ github.workspace }}/cloudflare-template - name: Remix Build run: pnpm build - working-directory: ${{ github.workspace }}/cloudlfare-template + working-directory: ${{ github.workspace }}/cloudflare-template - name: WRANGLER Build run: | @@ -122,4 +114,4 @@ jobs: --outdir dist \ './functions/[[path]].ts' - working-directory: ${{ github.workspace }}/cloudlfare-template + working-directory: ${{ github.workspace }}/cloudflare-template From d951f5d9e37c1f5ba6b3c51847894e4380892eae Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 20 Apr 2024 14:09:31 +0300 Subject: [PATCH 3/6] Fix naming --- .../.webstudio/config.json | 0 .../.webstudio/data.json | 0 .../WS_CF_README.md | 0 .../app/__generated__/[sitemap.xml].ts | 0 .../app/__generated__/_index.server.tsx | 0 .../app/__generated__/_index.tsx | 0 .../app/__generated__/index.css | 0 .../app/constants.mjs | 0 .../app/extension.ts | 0 .../app/root.tsx | 0 .../app/routes/[robots.txt].tsx | 0 .../app/routes/[sitemap.xml].tsx | 0 .../app/routes/_index.tsx | 0 .../functions/[[path]].ts | 0 .../load-context.ts | 0 .../package.json | 2 +- .../public/favicon.ico | Bin .../tsconfig.json | 0 .../vite.config.ts | 0 .../worker-configuration.d.ts | 0 .../wrangler.toml | 0 21 files changed, 1 insertion(+), 1 deletion(-) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/.webstudio/config.json (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/.webstudio/data.json (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/WS_CF_README.md (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/__generated__/[sitemap.xml].ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/__generated__/_index.server.tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/__generated__/_index.tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/__generated__/index.css (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/constants.mjs (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/extension.ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/root.tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/routes/[robots.txt].tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/routes/[sitemap.xml].tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/app/routes/_index.tsx (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/functions/[[path]].ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/load-context.ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/package.json (98%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/public/favicon.ico (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/tsconfig.json (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/vite.config.ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/worker-configuration.d.ts (100%) rename fixtures/{webstudio-cloudlfare-template => webstudio-cloudflare-template}/wrangler.toml (100%) diff --git a/fixtures/webstudio-cloudlfare-template/.webstudio/config.json b/fixtures/webstudio-cloudflare-template/.webstudio/config.json similarity index 100% rename from fixtures/webstudio-cloudlfare-template/.webstudio/config.json rename to fixtures/webstudio-cloudflare-template/.webstudio/config.json diff --git a/fixtures/webstudio-cloudlfare-template/.webstudio/data.json b/fixtures/webstudio-cloudflare-template/.webstudio/data.json similarity index 100% rename from fixtures/webstudio-cloudlfare-template/.webstudio/data.json rename to fixtures/webstudio-cloudflare-template/.webstudio/data.json diff --git a/fixtures/webstudio-cloudlfare-template/WS_CF_README.md b/fixtures/webstudio-cloudflare-template/WS_CF_README.md similarity index 100% rename from fixtures/webstudio-cloudlfare-template/WS_CF_README.md rename to fixtures/webstudio-cloudflare-template/WS_CF_README.md diff --git a/fixtures/webstudio-cloudlfare-template/app/__generated__/[sitemap.xml].ts b/fixtures/webstudio-cloudflare-template/app/__generated__/[sitemap.xml].ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/__generated__/[sitemap.xml].ts rename to fixtures/webstudio-cloudflare-template/app/__generated__/[sitemap.xml].ts diff --git a/fixtures/webstudio-cloudlfare-template/app/__generated__/_index.server.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/__generated__/_index.server.tsx rename to fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx diff --git a/fixtures/webstudio-cloudlfare-template/app/__generated__/_index.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/__generated__/_index.tsx rename to fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx diff --git a/fixtures/webstudio-cloudlfare-template/app/__generated__/index.css b/fixtures/webstudio-cloudflare-template/app/__generated__/index.css similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/__generated__/index.css rename to fixtures/webstudio-cloudflare-template/app/__generated__/index.css diff --git a/fixtures/webstudio-cloudlfare-template/app/constants.mjs b/fixtures/webstudio-cloudflare-template/app/constants.mjs similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/constants.mjs rename to fixtures/webstudio-cloudflare-template/app/constants.mjs diff --git a/fixtures/webstudio-cloudlfare-template/app/extension.ts b/fixtures/webstudio-cloudflare-template/app/extension.ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/extension.ts rename to fixtures/webstudio-cloudflare-template/app/extension.ts diff --git a/fixtures/webstudio-cloudlfare-template/app/root.tsx b/fixtures/webstudio-cloudflare-template/app/root.tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/root.tsx rename to fixtures/webstudio-cloudflare-template/app/root.tsx diff --git a/fixtures/webstudio-cloudlfare-template/app/routes/[robots.txt].tsx b/fixtures/webstudio-cloudflare-template/app/routes/[robots.txt].tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/routes/[robots.txt].tsx rename to fixtures/webstudio-cloudflare-template/app/routes/[robots.txt].tsx diff --git a/fixtures/webstudio-cloudlfare-template/app/routes/[sitemap.xml].tsx b/fixtures/webstudio-cloudflare-template/app/routes/[sitemap.xml].tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/routes/[sitemap.xml].tsx rename to fixtures/webstudio-cloudflare-template/app/routes/[sitemap.xml].tsx diff --git a/fixtures/webstudio-cloudlfare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx similarity index 100% rename from fixtures/webstudio-cloudlfare-template/app/routes/_index.tsx rename to fixtures/webstudio-cloudflare-template/app/routes/_index.tsx diff --git a/fixtures/webstudio-cloudlfare-template/functions/[[path]].ts b/fixtures/webstudio-cloudflare-template/functions/[[path]].ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/functions/[[path]].ts rename to fixtures/webstudio-cloudflare-template/functions/[[path]].ts diff --git a/fixtures/webstudio-cloudlfare-template/load-context.ts b/fixtures/webstudio-cloudflare-template/load-context.ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/load-context.ts rename to fixtures/webstudio-cloudflare-template/load-context.ts diff --git a/fixtures/webstudio-cloudlfare-template/package.json b/fixtures/webstudio-cloudflare-template/package.json similarity index 98% rename from fixtures/webstudio-cloudlfare-template/package.json rename to fixtures/webstudio-cloudflare-template/package.json index 104536bbd691..3247f0ac1219 100644 --- a/fixtures/webstudio-cloudlfare-template/package.json +++ b/fixtures/webstudio-cloudflare-template/package.json @@ -15,7 +15,7 @@ }, "private": true, "sideEffects": false, - "name": "webstudio-cloudlfare-template", + "name": "webstudio-cloudflare-template", "version": "0.0.1", "description": "", "main": "index.js", diff --git a/fixtures/webstudio-cloudlfare-template/public/favicon.ico b/fixtures/webstudio-cloudflare-template/public/favicon.ico similarity index 100% rename from fixtures/webstudio-cloudlfare-template/public/favicon.ico rename to fixtures/webstudio-cloudflare-template/public/favicon.ico diff --git a/fixtures/webstudio-cloudlfare-template/tsconfig.json b/fixtures/webstudio-cloudflare-template/tsconfig.json similarity index 100% rename from fixtures/webstudio-cloudlfare-template/tsconfig.json rename to fixtures/webstudio-cloudflare-template/tsconfig.json diff --git a/fixtures/webstudio-cloudlfare-template/vite.config.ts b/fixtures/webstudio-cloudflare-template/vite.config.ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/vite.config.ts rename to fixtures/webstudio-cloudflare-template/vite.config.ts diff --git a/fixtures/webstudio-cloudlfare-template/worker-configuration.d.ts b/fixtures/webstudio-cloudflare-template/worker-configuration.d.ts similarity index 100% rename from fixtures/webstudio-cloudlfare-template/worker-configuration.d.ts rename to fixtures/webstudio-cloudflare-template/worker-configuration.d.ts diff --git a/fixtures/webstudio-cloudlfare-template/wrangler.toml b/fixtures/webstudio-cloudflare-template/wrangler.toml similarity index 100% rename from fixtures/webstudio-cloudlfare-template/wrangler.toml rename to fixtures/webstudio-cloudflare-template/wrangler.toml From 9696e6cda26cac86f86645498aa3baa9948543d2 Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 20 Apr 2024 14:09:42 +0300 Subject: [PATCH 4/6] Fix name --- pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 072c6b354c8a..5bcf653f4f9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -455,7 +455,7 @@ importers: specifier: ^5.2.8 version: 5.2.8(@types/node@18.17.1) - fixtures/webstudio-cloudlfare-template: + fixtures/webstudio-cloudflare-template: dependencies: '@remix-run/cloudflare': specifier: ^2.8.1 From 4c6f15b84dd7e831218be29f50e7c138315999d6 Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 20 Apr 2024 14:14:20 +0300 Subject: [PATCH 5/6] Fix name --- .github/workflows/cli-r2.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-r2.yaml b/.github/workflows/cli-r2.yaml index 42ad32215678..b9e57b322d7f 100644 --- a/.github/workflows/cli-r2.yaml +++ b/.github/workflows/cli-r2.yaml @@ -57,12 +57,12 @@ jobs: - name: Copy artifact run: | # For staging - aws s3 cp cloudflare-template.tar.zst "s3:/${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.ref_name }}.tar.zst" + aws s3 cp cloudflare-template.tar.zst "s3://${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.ref_name }}.tar.zst" # For production can be cached forever aws s3 cp \ --metadata-directive REPLACE --cache-control "public,max-age=31536102,immutable" \ - cloudflare-template.tar.zst "s3:/${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.sha }}.tar.zst" + cloudflare-template.tar.zst "s3://${ARTEFACT_BUCKET_NAME}/public/cloudflare-template/${{ github.sha }}.tar.zst" working-directory: ${{ github.workspace }}/.. env: From 1aad36753dbd1b5db47b41164e23a6522a6cb556 Mon Sep 17 00:00:00 2001 From: istarkov Date: Sat, 20 Apr 2024 14:25:35 +0300 Subject: [PATCH 6/6] Empty-Commit