From 2172298f3ffdb6128d810ced45b1c77b069b0bd7 Mon Sep 17 00:00:00 2001 From: David Melendez Date: Thu, 11 Sep 2025 16:48:19 -0600 Subject: [PATCH 1/4] feat: Add debugging process document between StarkLotto and Debug_Starklotto - scarb file is configured correctly --- DEBUGGING_PROCESS.md | 110 ++++++++++++++++++++++++ packages/snfoundry/contracts/Scarb.toml | 31 ++++--- 2 files changed, 129 insertions(+), 12 deletions(-) create mode 100644 DEBUGGING_PROCESS.md diff --git a/DEBUGGING_PROCESS.md b/DEBUGGING_PROCESS.md new file mode 100644 index 0000000..0cfc4a3 --- /dev/null +++ b/DEBUGGING_PROCESS.md @@ -0,0 +1,110 @@ +# 🔧 Proceso de Debugging entre StarkLotto y Debug_Starklotto + +## 📌 Description +Este documento explica el proceso para sincronizar y debuguear contratos entre el proyecto principal **StarkLotto** y el proyecto de debugging **Debug_Starklotto**. El proceso permite que ambos proyectos vean y interactúen con los mismos contratos desplegados en la misma red. + +## 🎯 Motivation and Context +Para facilitar el desarrollo y debugging de contratos inteligentes en Starknet, necesitamos un proceso estandarizado que permita: + +- **Sincronización de contratos**: Ambos proyectos deben ver los mismos contratos desplegados +- **Debugging eficiente**: Poder debuguear contratos desde el proyecto de desarrollo sin afectar el principal +- **Consistencia de datos**: Mantener la misma información de contratos en ambos entornos +- **Flujo de trabajo optimizado**: Proceso claro y repetible para el equipo de desarrollo + +## 🛠️ How to Test the Change (if applicable) +Describe the steps to test your changes: + +### 🔹 Paso 1: Hacer Deploy en StarkLotto +1. Navegar al proyecto principal **StarkLotto** +2. Ejecutar el comando de deploy: + ```bash + yarn deploy + ``` +3. Verificar que los contratos se hayan desplegado correctamente + +### 🔹 Paso 2: Copiar archivo deployedContracts.ts +1. En el proyecto **StarkLotto**, localizar el archivo generado: + ``` + packages/nextjs/contracts/deployedContracts.ts + ``` +2. Copiar todo el contenido del archivo +3. En el proyecto **Debug_Starklotto**, reemplazar el archivo: + ``` + packages/nextjs/contracts/deployedContracts.ts + ``` +4. Verificar que el archivo se haya actualizado correctamente + +### 🔹 Paso 3: Levantar el sitio y debuguear +1. En el proyecto **Debug_Starklotto**, instalar dependencias: + ```bash + yarn install + ``` +2. Levantar el servidor de desarrollo: + ```bash + yarn start + # o + yarn dev + ``` +3. Navegar a la página de debugging: + ``` + http://localhost:3000/debug + ``` +4. Verificar que los contratos aparezcan correctamente +5. Probar las funciones de debugging disponibles + +### 🔹 Paso 4: Verificar sincronización +1. Verificar que ambos proyectos apunten a la misma red (devnet/testnet) +2. Probar una transacción desde el proyecto de debugging +3. Confirmar que los cambios se reflejen en ambos proyectos + +## 🖼️ Screenshots (if applicable) +Si aplica, agregar capturas de pantalla o videos de los resultados de las pruebas. + +## 🔍 Type of Change +- [x] 📖 **Documentation** - Updates or creates new documentation. +- [x] ✨ **New Feature** - Adds a new feature or functionality. +- [ ] 🐞 **Bugfix** - Fixes an existing issue or bug in the code. +- [ ] 🚀 **Hotfix** - A quick fix for a critical issue in production. +- [ ] 🔄 **Refactoring** - Improves the code structure without changing its behavior. +- [ ] ❓ **Other (please specify)** - Any other change that does not fit into the categories above. + +## ✅ Checklist Before Merging +- [x] 🧪 I have tested the code and it works as expected. +- [x] 🎨 My changes follow the project's coding style. +- [x] 📖 I have updated the documentation if necessary. +- [x] ⚠️ No new warnings or errors were introduced. +- [x] 🔍 I have reviewed and approved my own code before submitting. + +## 📌 Additional Notes + +### Estructura de Contratos Sincronizados +El archivo `deployedContracts.ts` contiene la información de los siguientes contratos: + +- **StarkPlayERC20**: Token ERC20 personalizado con funcionalidades de mint, burn y premios +- **StarkPlayVault**: Vault para manejo de fondos y conversión de tokens +- **Lottery**: Contrato principal de la lotería con funcionalidades de tickets y sorteos + +### Consideraciones Importantes + +1. **Red de Despliegue**: Asegurarse de que ambos proyectos estén configurados para la misma red (devnet/testnet/mainnet) + +2. **Versiones de Contratos**: Los contratos deben estar en la misma versión en ambos proyectos para evitar incompatibilidades + +3. **Configuración de Red**: Verificar que la configuración de red en `scaffold.config.ts` sea consistente + +### Flujo de Trabajo Recomendado + +1. **Desarrollo**: Trabajar en el proyecto principal StarkLotto +2. **Deploy**: Desplegar contratos cuando estén listos para testing +3. **Sincronización**: Copiar el archivo de contratos al proyecto de debugging +4. **Testing**: Realizar pruebas exhaustivas en el entorno de debugging +5. **Iteración**: Repetir el proceso según sea necesario + +### Herramientas de Debugging Disponibles + +- **Interfaz de Contratos**: Acceso directo a todas las funciones de los contratos +- **Visualización de Eventos**: Monitoreo de eventos en tiempo real +- **Testing de Transacciones**: Prueba de funciones sin afectar el entorno principal +- **Análisis de Estado**: Verificación del estado actual de los contratos + +Este proceso garantiza un flujo de trabajo eficiente y seguro para el desarrollo y debugging de contratos inteligentes en Starknet. diff --git a/packages/snfoundry/contracts/Scarb.toml b/packages/snfoundry/contracts/Scarb.toml index 7b8bc68..6a9f000 100644 --- a/packages/snfoundry/contracts/Scarb.toml +++ b/packages/snfoundry/contracts/Scarb.toml @@ -7,22 +7,23 @@ edition = "2024_07" [dependencies] starknet = "2.11.4" -openzeppelin_access = "2.0.0" -openzeppelin_token = "2.0.0" +# Change to just "openzeppelin" to use full features +openzeppelin_access = "1.0.0" +openzeppelin_introspection = "1.0.0" +openzeppelin_security = "1.0.0" +openzeppelin_token = "1.0.0" +openzeppelin_upgrades = "1.0.0" [dev-dependencies] -openzeppelin_utils = "2.0.0" -openzeppelin_testing = "4.3.0" -snforge_std = "0.42.0" +openzeppelin_utils = "1.0.0" +openzeppelin_testing = "3.0.0" +snforge_std = "0.41.0" assert_macros = "2.11.4" +cairo_test = "2.11.4" [[target.starknet-contract]] casm = true # taggle this to `false` to speed up compilation/script tests - -[tool.scarb] -allow-prebuilt-plugins = [ - "snforge_std", -] # Avoids the need to install Rust for snforge_std/starknet-foundry +sierra = true [tool.fmt] sort-module-level-items = true @@ -32,6 +33,12 @@ name = "SEPOLIA_LATEST" url = "https://starknet-sepolia.public.blastapi.io/rpc/v0_8" block_id.tag = "latest" -[tool] -panic-backtrace = true +[tool.snforge] +exit_first = true + +[tool.scarb] +allow-warnings = false +allow-prebuilt-plugins = [ + "snforge_std", +] # Avoids the need to install Rust for snforge_std/starknet-foundry \ No newline at end of file From 616fbbb247bc8995f5a07ae7898d2cf6e6668351 Mon Sep 17 00:00:00 2001 From: David Melendez Date: Thu, 11 Sep 2025 17:03:50 -0600 Subject: [PATCH 2/4] scarb.lock file --- packages/snfoundry/contracts/Scarb.lock | 48 ++++++++++++++++--------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/packages/snfoundry/contracts/Scarb.lock b/packages/snfoundry/contracts/Scarb.lock index 3a8f284..fd15884 100644 --- a/packages/snfoundry/contracts/Scarb.lock +++ b/packages/snfoundry/contracts/Scarb.lock @@ -6,26 +6,30 @@ name = "contracts" version = "0.2.0" dependencies = [ "openzeppelin_access", + "openzeppelin_introspection", + "openzeppelin_security", "openzeppelin_testing", "openzeppelin_token", + "openzeppelin_upgrades", "openzeppelin_utils", "snforge_std", ] [[package]] name = "openzeppelin_access" -version = "2.0.0" +version = "1.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:511681dd26d814ee2bc996d44ff8cb4aaa5ae9d14272130def7eb901cf004850" +checksum = "sha256:a39a4ea1582916c637bf7e3aee0832c3fe1ea3a3e39191955e8dc39d08327f9b" dependencies = [ "openzeppelin_introspection", + "openzeppelin_utils", ] [[package]] name = "openzeppelin_account" -version = "2.0.0" +version = "1.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:fb3381c50d68b028d3801feb43df378e2bd62137b6884844f8f60aefe796188b" +checksum = "sha256:7e943a2de32ddca4d48e467e52790e380ab1f49c4daddbbbc4634dd930d0243f" dependencies = [ "openzeppelin_introspection", "openzeppelin_utils", @@ -33,24 +37,30 @@ dependencies = [ [[package]] name = "openzeppelin_introspection" -version = "2.0.0" +version = "1.0.0" +source = "registry+https://scarbs.xyz/" +checksum = "sha256:34e088ecf19e0b3012481a29f1fbb20e600540cb9a5db1c3002a97ebb7f5a32a" + +[[package]] +name = "openzeppelin_security" +version = "1.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:87773ed6cd2318f169283ecbbb161890d1996260a80302d81ec45b70ee5e54c1" +checksum = "sha256:1deb811a239c4f9cc28fc302039e2ffcb19911698a8c612487207448d70d2e6e" [[package]] name = "openzeppelin_testing" -version = "4.3.0" +version = "3.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:0cbdd8531a4bf7474a06492a671ed09f3b555e90e4a65180db341fcb43e2bcc1" +checksum = "sha256:fef2baa73bc86044edcc63eec7a8345c652a7f90420b987d811251736f7eb317" dependencies = [ "snforge_std", ] [[package]] name = "openzeppelin_token" -version = "2.0.0" +version = "1.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:6fe61f63b5a6706018265fb7373b6e5bd3ff829bdc760b2b90296b1e708d180c" +checksum = "sha256:33fcb84a1a76d2d3fff9302094ff564f78d45b743548fd7568c130b272473f66" dependencies = [ "openzeppelin_access", "openzeppelin_account", @@ -58,23 +68,29 @@ dependencies = [ "openzeppelin_utils", ] +[[package]] +name = "openzeppelin_upgrades" +version = "1.0.0" +source = "registry+https://scarbs.xyz/" +checksum = "sha256:36f7a03e7e7111577916aacf31f88ad0053de20f33ee10b0ab3804849c3aa373" + [[package]] name = "openzeppelin_utils" -version = "2.0.0" +version = "1.0.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:bf799c794139837f397975ffdf6a7ed5032d198bbf70e87a8f44f144a9dfc505" +checksum = "sha256:fd348b31c4a4407add33adc3c2b8f26dca71dbd7431faaf726168f37a91db0c1" [[package]] name = "snforge_scarb_plugin" -version = "0.46.0" +version = "0.41.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:6ffa10fe0ff525678138afd584fc2012e7b248f9c8e7b44aeae033cef3ee7826" +checksum = "sha256:7228a3ea74d8decfb2294cee9251b537bbd58b3e243e9327f55e72a99ab5fb53" [[package]] name = "snforge_std" -version = "0.46.0" +version = "0.41.0" source = "registry+https://scarbs.xyz/" -checksum = "sha256:a4d4b4d3e8506a3907d1eabacb058c390aa13a70132f475cba5e3dcd7a60d0bb" +checksum = "sha256:edf116cbf62cbe2487f188cf28ceb9f42b08cfa14e197524281c3ce932f4a5e6" dependencies = [ "snforge_scarb_plugin", ] From ed6cad154223da096df77dbd64653a88de4b1d3d Mon Sep 17 00:00:00 2001 From: David Melendez Date: Thu, 11 Sep 2025 17:06:52 -0600 Subject: [PATCH 3/4] tools versions --- packages/snfoundry/.tool-versions | 3 +++ packages/snfoundry/contracts/.tool-versions | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 packages/snfoundry/.tool-versions create mode 100644 packages/snfoundry/contracts/.tool-versions diff --git a/packages/snfoundry/.tool-versions b/packages/snfoundry/.tool-versions new file mode 100644 index 0000000..b880b1e --- /dev/null +++ b/packages/snfoundry/.tool-versions @@ -0,0 +1,3 @@ +starknet-devnet 0.4.0 +starknet-foundry 0.41.0 +scarb 2.11.4 diff --git a/packages/snfoundry/contracts/.tool-versions b/packages/snfoundry/contracts/.tool-versions new file mode 100644 index 0000000..3004df8 --- /dev/null +++ b/packages/snfoundry/contracts/.tool-versions @@ -0,0 +1,3 @@ +scarb 2.11.4 +starknet-foundry 0.41.0 +starknet-devnet 0.4.0 From 44f951d7ef5e63e784e505be62ff007b898381b6 Mon Sep 17 00:00:00 2001 From: David Melendez Date: Thu, 11 Sep 2025 17:16:34 -0600 Subject: [PATCH 4/4] update worklfows --- .github/workflows/demo.yaml | 34 +----- .github/workflows/main.yml | 64 ++++------- .github/workflows/release-create-stark.yaml | 10 +- .github/workflows/snfoundry.yml | 49 +++++++++ .github/workflows/sync-basecamp-repo.yaml | 103 ------------------ .../workflows/sync-bulletproof-contracts.yaml | 64 ----------- .github/workflows/sync-speedrun-repo.yaml | 96 ---------------- 7 files changed, 80 insertions(+), 340 deletions(-) create mode 100644 .github/workflows/snfoundry.yml delete mode 100644 .github/workflows/sync-basecamp-repo.yaml delete mode 100644 .github/workflows/sync-bulletproof-contracts.yaml delete mode 100644 .github/workflows/sync-speedrun-repo.yaml diff --git a/.github/workflows/demo.yaml b/.github/workflows/demo.yaml index 5d82ab2..3b7b482 100644 --- a/.github/workflows/demo.yaml +++ b/.github/workflows/demo.yaml @@ -19,17 +19,6 @@ jobs: token: ${{ secrets.ORG_GITHUB_TOKEN }} path: source_repo - - name: Install scarb - uses: software-mansion/setup-scarb@v1 - with: - tool-versions: ./.tool-versions - scarb-lock: ./packages/snfoundry/contracts/Scarb.lock - - - name: Install snfoundryup - uses: foundry-rs/setup-snfoundry@v3 - with: - tool-versions: ./.tool-versions - - name: Modify scaffoldConfig in Source Repository run: | cd source_repo @@ -39,26 +28,9 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 22 + node-version: 20 registry-url: "https://registry.yarnpkg.com" - # TODO: setup yarn cache - - name: Install dependencies - run: | - cd source_repo - yarn install - - - name: Deploy contracts to Sepolia - if: success() - id: deploy-contract - env: - PRIVATE_KEY_SEPOLIA: ${{ secrets.PRIVATE_KEY_SEPOLIA }} - ACCOUNT_ADDRESS_SEPOLIA: ${{ secrets.ACCOUNT_ADDRESS_SEPOLIA }} - RPC_URL_SEPOLIA: ${{ secrets.RPC_URL_SEPOLIA }} - run: | - cd source_repo - yarn deploy --network sepolia - - name: Deploy to vercel if: success() id: deploy @@ -66,11 +38,11 @@ jobs: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} - RPC_URL_SEPOLIA: ${{ secrets.RPC_URL_SEPOLIA }} run: | cd source_repo + yarn install vercel link --yes --project $VERCEL_PROJECT_ID --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID - vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true --build-env NEXT_PUBLIC_SEPOLIA_PROVIDER_URL=$RPC_URL_SEPOLIA --prod --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID + vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true --prod --token $VERCEL_TOKEN --scope $VERCEL_ORG_ID - name: Notify Slack on Success if: success() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c666c9..4ab0cd6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,72 +2,54 @@ name: Next.js CI on: push: + branches: [dev] paths: - - "packages/snfoundry/contracts/**" - "packages/nextjs/**" + - ".github/workflows/**" pull_request: - branches: - - main - - develop + branches: [dev] paths: - "packages/nextjs/**" - - "packages/snfoundry/**" + - ".github/workflows/**" + jobs: - ci: - runs-on: ${{ matrix.os }} + build-and-test: + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest] - node: [lts/*] + node-version: [20.x] steps: - - name: Checkout - uses: actions/checkout@master + - name: 📦 Checkout code + uses: actions/checkout@v3 - - name: Setup node env + - name: 🔧 Setup Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} - cache: "yarn" + node-version: ${{ matrix.node-version }} + cache: yarn - - name: Install dependencies (Next.js) + - name: 📦 Install dependencies run: yarn install --immutable working-directory: ./packages/nextjs - - name: Install scarb - uses: software-mansion/setup-scarb@v1 - with: - tool-versions: ./.tool-versions - scarb-lock: ./packages/snfoundry/contracts/Scarb.lock - - - name: Install snfoundryup - uses: foundry-rs/setup-snfoundry@v3 - with: - tool-versions: ./.tool-versions - - - name: Build Contracts - run: yarn compile - - - name: Run smart contract tests + - name: 🧪 Run Vitest run: yarn test - - - name: Check Code Format - run: yarn format:check - - - name: Run Next.js lint - run: yarn next:lint --max-warnings=0 + working-directory: ./packages/nextjs + - name: 🔍 Run ESLint + run: yarn lint working-directory: ./packages/nextjs - - name: Check typings on Next.js - run: yarn next:check-types + - name: 🎨 Format Check + run: yarn format:check working-directory: ./packages/nextjs - - name: Run Next.js tests - run: yarn test + - name: 🔡 Type Check + run: yarn check-types working-directory: ./packages/nextjs - - name: Build Next.js project + - name: 🏗️ Build App run: yarn build working-directory: ./packages/nextjs diff --git a/.github/workflows/release-create-stark.yaml b/.github/workflows/release-create-stark.yaml index 1d4965b..33f8b42 100644 --- a/.github/workflows/release-create-stark.yaml +++ b/.github/workflows/release-create-stark.yaml @@ -75,7 +75,7 @@ jobs: - name: Copy Files to Destination Repository run: | - rsync -av --delete \ + rsync -av --delete \ --exclude='.git/' \ --include='.github/' \ --include='.github/workflows/' \ @@ -86,9 +86,9 @@ jobs: --exclude='CHANGELOG*' \ --exclude='CONTRIBUTING*' \ source_repo/ destination_repo/templates/base - cd destination_repo - git add . - git commit -m "chore: sync files from scaffold-stark-2 [skip ci]" + cd destination_repo + git add . + git commit -m "chore: sync files from scaffold-stark-2 [skip ci]" - name: Format .gitignore files run: | @@ -119,7 +119,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: "22" + node-version: "16" registry-url: "https://registry.npmjs.org/" - name: Publish release diff --git a/.github/workflows/snfoundry.yml b/.github/workflows/snfoundry.yml new file mode 100644 index 0000000..04d840b --- /dev/null +++ b/.github/workflows/snfoundry.yml @@ -0,0 +1,49 @@ +name: Snfoundry Contracts CI + +on: + push: + branches: [dev] + paths: + - "packages/snfoundry/contracts/**" + pull_request: + branches: [dev] + paths: + - "packages/snfoundry/contracts/**" + - ".github/workflows/**" + +jobs: + build-and-test-contracts: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup scarb + uses: software-mansion/setup-scarb@v1 + with: + tool-versions: ./.tool-versions + scarb-lock: ./packages/snfoundry/contracts/Scarb.lock + + - name: Setup snfoundry + uses: foundry-rs/setup-snfoundry@v3 + with: + tool-versions: ./.tool-versions + + - name: Compile contracts + run: scarb build + working-directory: ./packages/snfoundry/contracts + + # Diagnóstico previo: lista todos los tests detectados + - name: List tests + run: snforge test -- --list + working-directory: ./packages/snfoundry/contracts + + # Ejecuta tests en modo verbose, imprime logs y stacktrace si algo falla. + # SNFORGE_FORMAT=pretty fuerza salida legible (no JSON), evitando parsers aguas abajo. + - name: Run snfoundry tests (verbose + logs) + env: + RUST_BACKTRACE: 1 + SNFORGE_FORMAT: pretty + run: snforge test -- -v --print-logs + working-directory: ./packages/snfoundry/contracts diff --git a/.github/workflows/sync-basecamp-repo.yaml b/.github/workflows/sync-basecamp-repo.yaml deleted file mode 100644 index 45ac931..0000000 --- a/.github/workflows/sync-basecamp-repo.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: Basecamp Sync and Update - -on: - pull_request: - types: [closed] - branches: [main] - -jobs: - check_commit: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - outputs: - SHOULD_RUN: ${{ steps.check_commit.outputs.SHOULD_RUN }} - steps: - - name: Checkout Files - uses: actions/checkout@v4 - with: - token: ${{ secrets.ORG_GITHUB_TOKEN }} - - - name: check if skip ci - id: check_commit - run: | - COMMIT_MESSAGE=$(git log -1 --pretty=%B) - if [[ "$COMMIT_MESSAGE" == *"[skip ci]"* ]]; then - echo "SHOULD_RUN=false" >> "$GITHUB_OUTPUT" - else - echo "SHOULD_RUN=true" >> "$GITHUB_OUTPUT" - fi - - sync-basecamp: - needs: check_commit - if: ${{ needs.check_commit.outputs.SHOULD_RUN != 'false' }} - runs-on: ubuntu-22.04 - - steps: - - name: Checkout Source Repository - uses: actions/checkout@v4 - with: - repository: Scaffold-Stark/scaffold-stark-2 - token: ${{ secrets.ORG_GITHUB_TOKEN }} - path: source_repo - - - name: Checkout Basecamp Repository - uses: actions/checkout@v4 - with: - repository: Scaffold-Stark/basecamp - token: ${{ secrets.ORG_GITHUB_TOKEN }} - path: basecamp_repo - fetch-depth: 0 - - - name: Setup Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Sync Base Branch - run: | - cd basecamp_repo - git checkout base - rsync -av --delete \ - --exclude='.git/' \ - --include='.github/' \ - --include='.github/workflows/' \ - --include='.github/workflows/main.yml' \ - --exclude='.github/*' \ - --exclude='.github/workflows/*' \ - --exclude='__test*__' \ - --exclude='packages/nextjs/public/debug-image.png' \ - --exclude='packages/nextjs/public/manifest.json' \ - --exclude='packages/nextjs/public/rpc-version.png' \ - --exclude='CHANGELOG*' \ - --exclude='CONTRIBUTING*' \ - --exclude='README.md' \ - ../source_repo/ ./ - git add . - git commit -m "chore: sync files from scaffold-stark-2 [skip ci]" - git push origin base - - - name: Update Step Branches - run: | - cd basecamp_repo - git checkout step-0 && git merge base --no-edit && git push origin step-0 - git checkout step-1 && git merge step-0 --no-edit && git push origin step-1 - git checkout step-2 && git merge step-1 --no-edit && git push origin step-2 - git checkout step-3 && git merge step-2 --no-edit && git push origin step-3 - - - name: Notify Slack on Success - if: success() - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - slack-message: "Successfully synced scaffold-stark-2 changes to basecamp repository and updated all step branches." - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - - name: Notify Slack on Failure - if: failure() - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - slack-message: "Failed to sync scaffold-stark-2 changes to basecamp repository." - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/sync-bulletproof-contracts.yaml b/.github/workflows/sync-bulletproof-contracts.yaml deleted file mode 100644 index 8119f85..0000000 --- a/.github/workflows/sync-bulletproof-contracts.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: Sync Main to v3-bulletproof-contracts for E2E Tests - -on: - push: - branches: - - main - -jobs: - sync-and-update: - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - name: Checkout main branch - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: main - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Detect changes to .tool-versions - id: check_changes - run: | - git fetch origin v3-bulletproof-contracts - git diff origin/v3-bulletproof-contracts..HEAD --name-only > changed_files.txt - if grep -q ".tool-versions" changed_files.txt; then - echo "tool_changed=true" >> $GITHUB_OUTPUT - else - echo "tool_changed=false" >> $GITHUB_OUTPUT - fi - - - name: Extract versions from .tool-versions - if: steps.check_changes.outputs.tool_changed == 'true' - id: get_versions - run: | - SCARB_VERSION=$(grep '^scarb ' .tool-versions | awk '{print $2}') - DEVNET_VERSION=$(grep '^starknet-devnet ' .tool-versions | awk '{print $2}') - echo "scarb_version=$SCARB_VERSION" >> $GITHUB_OUTPUT - echo "devnet_version=$DEVNET_VERSION" >> $GITHUB_OUTPUT - - - name: Checkout v3-bulletproof-contracts branch - run: | - git fetch origin - git checkout v3-bulletproof-contracts - - - name: Update Dockerfile and docker-compose.yml - if: steps.check_changes.outputs.tool_changed == 'true' - run: | - sed -i "s|^FROM starknetfoundation/starknet-dev:.*|FROM starknetfoundation/starknet-dev:${{ steps.get_versions.outputs.scarb_version }}|" ui-automation/Dockerfile.nextjs || echo "Dockerfile not found" - sed -i "s|image: shardlabs/starknet-devnet-rs:.*|image: shardlabs/starknet-devnet-rs:${{ steps.get_versions.outputs.devnet_version }}|" ui-automation/docker-compose.yml || echo "Compose file not found" - - git add ui-automation/Dockerfile.nextjs ui-automation/docker-compose.yml || echo "No files to add" - git commit -m "chore: update Docker versions from .tool-versions [CI]" || echo "No commit needed" - - - name: Merge main into v3-bulletproof-contracts - run: | - git merge origin/main --no-edit || echo "No changes to merge" - git push origin v3-bulletproof-contracts \ No newline at end of file diff --git a/.github/workflows/sync-speedrun-repo.yaml b/.github/workflows/sync-speedrun-repo.yaml deleted file mode 100644 index efcf2e7..0000000 --- a/.github/workflows/sync-speedrun-repo.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: Speedrun Sync and Update - -on: - pull_request: - types: [closed] - branches: [main] - -jobs: - check_commit: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - outputs: - SHOULD_RUN: ${{ steps.check_commit.outputs.SHOULD_RUN }} - steps: - - name: Checkout Files - uses: actions/checkout@v4 - with: - token: ${{ secrets.ORG_GITHUB_TOKEN }} - - - name: check if skip ci - id: check_commit - run: | - COMMIT_MESSAGE=$(git log -1 --pretty=%B) - if [[ "$COMMIT_MESSAGE" == *"[skip ci]"* ]]; then - echo "SHOULD_RUN=false" >> "$GITHUB_OUTPUT" - else - echo "SHOULD_RUN=true" >> "$GITHUB_OUTPUT" - fi - - sync-speedrun: - needs: check_commit - if: ${{ needs.check_commit.outputs.SHOULD_RUN != 'false' }} - runs-on: ubuntu-22.04 - - steps: - - name: Checkout Source Repository - uses: actions/checkout@v4 - with: - repository: Scaffold-Stark/scaffold-stark-2 - token: ${{ secrets.ORG_GITHUB_TOKEN }} - path: source_repo - - - name: Checkout Destination Repository - uses: actions/checkout@v4 - with: - repository: Scaffold-Stark/speedrunstark - token: ${{ secrets.ORG_GITHUB_TOKEN }} - path: speedrun_repo - fetch-depth: 0 - - - name: Setup Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Sync Base Challenge Template Branch - run: | - cd speedrun_repo - git checkout base-challenge-template - rsync -av \ - --exclude='.git/' \ - --include='.github/' \ - --include='.github/workflows/' \ - --include='.github/workflows/main.yml' \ - --exclude='.github/*' \ - --exclude='.github/workflows/*' \ - --exclude='__test*__' \ - --exclude='packages/nextjs/public/debug-image.png' \ - --exclude='packages/nextjs/public/manifest.json' \ - --exclude='packages/nextjs/public/rpc-version.png' \ - --exclude='packages/snfoundry/contracts/src/YourContract.cairo' \ - --exclude='CHANGELOG*' \ - --exclude='CONTRIBUTING*' \ - --exclude='README.md' \ - ../source_repo/ ./ - git add . - git commit -m "chore: sync files from scaffold-stark-2" - git push origin base-challenge-template - - - name: Notify Slack on Success - if: success() - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - slack-message: "Successfully synced scaffold-stark-2 changes to speedrunstark repository base-challenge-template branch." - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - - name: Notify Slack on Failure - if: failure() - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - slack-message: "Failed to sync scaffold-stark-2 changes to speedrunstark repository." - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}