From 2416580010eb8a3b4e0e0bcb5da22a00deeb9d3b Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 00:35:18 +0800 Subject: [PATCH 1/7] Update:add cf workflow --- .github/workflows/cf-preview.yml | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/cf-preview.yml diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml new file mode 100644 index 00000000..4c40f553 --- /dev/null +++ b/.github/workflows/cf-preview.yml @@ -0,0 +1,73 @@ +name: preview + +on: + push: + +env: + FOUNDRY_PROFILE: ci + # PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + +permissions: + pull-requests: write + deployments: write + contents: write + +jobs: + build: + strategy: + fail-fast: true + name: MUD project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: pnpm/action-setup@v2.2.4 + name: Install pnpm + id: pnpm-install + with: + version: 8 + run_install: false + + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + # - name: Change Github config + # run: git config --global url."https://github.com/".insteadOf git@github.com:; + # run: git config --global url."https://".insteadOf git:// + + - name: Install dependencies + run: pnpm install --loglevel verbose --no-frozen-lockfile + + # - name: deploy on lattice testnet + # run: cd packages/contracts; pnpm run deploy:testnet + + - name: build + run: pnpm build + + + - name: Cloudflare Pages GitHub Action + # You may pin to the exact commit or the version. + # uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca + uses: cloudflare/pages-action@v1.5.0 + with: + # Cloudflare API Token + apiToken: ${{ secrets.cfApiToken }} + # Cloudflare Account ID + accountId: ${{ secrets.cfAccountId }} + # The name of the Pages project to upload to + projectName: mississippi + # The directory of static assets to upload + directory: ./packages/client/dist + # The name of the branch you want to deploy to + branch: feat-mvp + # The working directory in which to run Wrangler + \ No newline at end of file From 4ec48e55feac0be8701e2d3b1c7fcb4b9b75a3ce Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 00:49:46 +0800 Subject: [PATCH 2/7] Update --- .github/workflows/cf-preview.yml | 2 +- .gitignore | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml index 4c40f553..d600781c 100644 --- a/.github/workflows/cf-preview.yml +++ b/.github/workflows/cf-preview.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - cache: "pnpm" + # cache: "pnpm" - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 diff --git a/.gitignore b/.gitignore index 7907530c..42520063 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules .env packages/contracts/src/codegen/ -pnpm-lock.yaml packages/contracts/worlds.json .DS_Store # worlds.json From e4e210da64d792c022c6b90654724dbbb9f9b94c Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 00:55:26 +0800 Subject: [PATCH 3/7] Update workflow --- .github/workflows/cf-preview.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml index d600781c..0de55e4d 100644 --- a/.github/workflows/cf-preview.yml +++ b/.github/workflows/cf-preview.yml @@ -23,26 +23,19 @@ jobs: with: submodules: recursive - - uses: pnpm/action-setup@v2.2.4 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: false - - - uses: actions/setup-node@v3 + - name: Use Node.js 18 + uses: actions/setup-node@v2 with: node-version: 18 - # cache: "pnpm" + + - name: Install pnpm + run: npm install -g pnpm - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly - # - name: Change Github config - # run: git config --global url."https://github.com/".insteadOf git@github.com:; - # run: git config --global url."https://".insteadOf git:// - name: Install dependencies run: pnpm install --loglevel verbose --no-frozen-lockfile From 4b6c11878d29222cdb9c22d41416f7e6f42e4d99 Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 00:58:28 +0800 Subject: [PATCH 4/7] Update:auto deploy --- .github/workflows/cf-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml index 0de55e4d..7a8c2bbe 100644 --- a/.github/workflows/cf-preview.yml +++ b/.github/workflows/cf-preview.yml @@ -1,4 +1,4 @@ -name: preview +name: cf_auto_deploy on: push: From 9981951b8c0bfbfbd0343f138f57bac09d2b1e8b Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 01:05:18 +0800 Subject: [PATCH 5/7] Update:merge two auto deploy file to one --- .github/workflows/cf-preview.yml | 14 +++++- .github/workflows/vercel-preview.yaml | 65 --------------------------- 2 files changed, 12 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/vercel-preview.yaml diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml index 7a8c2bbe..d59ef2d4 100644 --- a/.github/workflows/cf-preview.yml +++ b/.github/workflows/cf-preview.yml @@ -40,8 +40,8 @@ jobs: - name: Install dependencies run: pnpm install --loglevel verbose --no-frozen-lockfile - # - name: deploy on lattice testnet - # run: cd packages/contracts; pnpm run deploy:testnet + - name: deploy on lattice testnet + run: cd packages/contracts; pnpm run deploy:testnet - name: build run: pnpm build @@ -63,4 +63,14 @@ jobs: # The name of the branch you want to deploy to branch: feat-mvp # The working directory in which to run Wrangler + + - name: Vercel Action + uses: amondnet/vercel-action@v25 + + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + vercel-org-id: ${{ secrets.ORG_ID}} #Required + vercel-project-id: ${{ secrets.PROJECT_ID}} #Required + working-directory: ./packages/client/dist + scope: ${{secrets.TEAM_SLUG}} \ No newline at end of file diff --git a/.github/workflows/vercel-preview.yaml b/.github/workflows/vercel-preview.yaml deleted file mode 100644 index c818f547..00000000 --- a/.github/workflows/vercel-preview.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: preview - -on: - push: - -env: - FOUNDRY_PROFILE: ci - # PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} - -permissions: - pull-requests: write - deployments: write - contents: write - -jobs: - build: - strategy: - fail-fast: true - - name: MUD project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - uses: pnpm/action-setup@v2.2.4 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: false - - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: "pnpm" - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - # - name: Change Github config - # run: git config --global url."https://github.com/".insteadOf git@github.com:; - # run: git config --global url."https://".insteadOf git:// - - - name: Install dependencies - run: pnpm install --loglevel verbose --no-frozen-lockfile - - # - name: deploy on lattice testnet - # run: cd packages/contracts; pnpm run deploy:testnet - - - name: build - run: pnpm build - - - name: Vercel Action - uses: amondnet/vercel-action@v25 - - with: - vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required - vercel-org-id: ${{ secrets.ORG_ID}} #Required - vercel-project-id: ${{ secrets.PROJECT_ID}} #Required - working-directory: ./packages/client/dist - scope: ${{secrets.TEAM_SLUG}} \ No newline at end of file From 702d89db4226ff40d00b957ba532ba33f20c281a Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 01:12:26 +0800 Subject: [PATCH 6/7] Update:update secret --- .github/workflows/cf-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cf-preview.yml b/.github/workflows/cf-preview.yml index d59ef2d4..e8d3cdcb 100644 --- a/.github/workflows/cf-preview.yml +++ b/.github/workflows/cf-preview.yml @@ -5,7 +5,7 @@ on: env: FOUNDRY_PROFILE: ci - # PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} permissions: pull-requests: write From 63801bce6ce5cd3bba759038b502dde262e1e7a1 Mon Sep 17 00:00:00 2001 From: LidamaoHub Date: Sun, 29 Oct 2023 01:43:24 +0800 Subject: [PATCH 7/7] Update:show dev --- packages/client/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 6473184e..dd825354 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -26,7 +26,7 @@ const root = ReactDOM.createRoot(rootElement); // https://vitejs.dev/guide/env-and-mode.html -if (import.meta.env.DEV) { +// if (import.meta.env.DEV) { const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); const comp = []; network.world.components.forEach((c) => { @@ -46,4 +46,4 @@ if (import.meta.env.DEV) { write$: network.write$, recsWorld: network.world, }); -} +// }