From 406acd483b17d76c6dad5df8ca129cce6be43001 Mon Sep 17 00:00:00 2001 From: biwano <11857992+biwano@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:14:02 +0100 Subject: [PATCH 1/5] test deployment --- .github/workflows/deploy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 29e65777..9378e903 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,6 +9,8 @@ name: Deployment on: push: branches: [main] + pull_request: + branches: [bwano/fix/carbonmark_token_standard] jobs: deploy: From a37822b9a6e34a771a5c9a6de0c67c59e8f06da1 Mon Sep 17 00:00:00 2001 From: biwano <11857992+biwano@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:17:11 +0100 Subject: [PATCH 2/5] test deployment --- .github/workflows/deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9378e903..2e90d156 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,6 +12,7 @@ on: pull_request: branches: [bwano/fix/carbonmark_token_standard] + jobs: deploy: name: Deploy From a1e2f07d5ca8d6b0c943e7b0c2d4285ac2e29146 Mon Sep 17 00:00:00 2001 From: biwano <11857992+biwano@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:17:48 +0100 Subject: [PATCH 3/5] test deployment --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2e90d156..4ba3a858 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,9 +10,9 @@ on: push: branches: [main] pull_request: - branches: [bwano/fix/carbonmark_token_standard] + branches: "*"" + - jobs: deploy: name: Deploy From 66fdf29c26e180c983c2344d3917da6782ff1214 Mon Sep 17 00:00:00 2001 From: biwano <11857992+biwano@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:18:25 +0100 Subject: [PATCH 4/5] test deployment --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4ba3a858..e0e216a6 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,7 +10,7 @@ on: push: branches: [main] pull_request: - branches: "*"" + branches: "*" jobs: From 8e3b72aa7d13847d678e75b37f4e6a23b95fd2e3 Mon Sep 17 00:00:00 2001 From: biwano <11857992+biwano@users.noreply.github.com> Date: Wed, 26 Nov 2025 08:20:52 +0100 Subject: [PATCH 5/5] test deployment --- .github/workflows/check-version.yaml | 116 --------------------------- .github/workflows/ci.yaml | 71 ---------------- .github/workflows/deploy-dev.yaml | 73 ----------------- .github/workflows/deploy.yaml | 1 - 4 files changed, 261 deletions(-) delete mode 100644 .github/workflows/check-version.yaml delete mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/deploy-dev.yaml diff --git a/.github/workflows/check-version.yaml b/.github/workflows/check-version.yaml deleted file mode 100644 index 0e945f5c..00000000 --- a/.github/workflows/check-version.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# .github/workflows/check-version-update.yml -# -# Fails a PR / push if: -# – any “core” file in a subgraph folder changes AND -# – the version field in that subgraph’s package.json stays the same -# -# “Core” files = src/**, schema.graphql, subgraph.yaml(+template) - -name: Check Version Update - -on: - push: - branches: - - '**' - pull_request: - branches: - - '**' -jobs: - check-version-update: - runs-on: ubuntu-latest - strategy: - matrix: - subgraph: - - bonds - - carbonmark - - protocol-metrics - - vesting - - user-carbon - - pairs - - celo-bridged-carbon - - ethereum-bridged-carbon - - polygon-digital-carbon - - steps: - # ──────────────────────────────────────────────────────────────── - # 0. Checkout and choose the HEAD commit we’re validating - # ──────────────────────────────────────────────────────────────── - - uses: actions/checkout@v4 - with: { fetch-depth: 0 } - - - name: Select HEAD SHA (PR vs push) - run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" - else - echo "HEAD_SHA=${{ github.sha }}" >> "$GITHUB_ENV" - fi - - - name: Fetch main branch for comparison - run: git fetch origin main --tags - - # ──────────────────────────────────────────────────────────────── - # 1. Detect changes inside the current subgraph folder - # ──────────────────────────────────────────────────────────────── - - name: Detect core / package changes in ${{ matrix.subgraph }} - id: detect - env: - SG: ${{ matrix.subgraph }} - shell: bash - run: | - ALL_CHANGED=$(git diff --name-only origin/main "$HEAD_SHA" -- "$SG/" || true) - - # Flag if package.json changed - if echo "$ALL_CHANGED" | grep -qx "$SG/package.json"; then - echo "pkg_changed=true" >> "$GITHUB_OUTPUT" - else - echo "pkg_changed=false" >> "$GITHUB_OUTPUT" - fi - - # Flag if any “core” file changed - CORE_REGEX="^$SG/(src/|schema\.graphql$|subgraph\.yaml$|subgraph\.template\.yaml$)" - if echo "$ALL_CHANGED" | grep -E "$CORE_REGEX" -q; then - echo "core_changed=true" >> "$GITHUB_OUTPUT" - else - echo "core_changed=false" >> "$GITHUB_OUTPUT" - fi - - # Persist full file list for optional debugging - echo "all_changed<> "$GITHUB_OUTPUT" - echo "$ALL_CHANGED" >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" - - # ──────────────────────────────────────────────────────────────── - # 2. Fail if core files changed but version didn’t bump - # ──────────────────────────────────────────────────────────────── - - name: Enforce version bump - if: steps.detect.outputs.core_changed == 'true' - env: - SG: ${{ matrix.subgraph }} - shell: bash - run: | - BASE_V=$(git show origin/main:$SG/package.json | jq -r .version) - NEW_V=$(git show "$HEAD_SHA":$SG/package.json | jq -r .version) - - echo "Base version: $BASE_V" - echo "New version: $NEW_V" - - if [[ "$BASE_V" == "$NEW_V" ]]; then - echo "::error file=$SG/package.json,title=Version bump required::Core files changed but version field stayed $BASE_V" - exit 1 - else - echo "✅ Version correctly bumped → $NEW_V" - fi - - # ──────────────────────────────────────────────────────────────── - # 3. Skip messages - # ──────────────────────────────────────────────────────────────── - - name: Skip – only package.json updated - if: steps.detect.outputs.core_changed == 'false' && steps.detect.outputs.pkg_changed == 'true' - run: | - echo "🟢 Only ${{ matrix.subgraph }}/package.json changed — version bump not required." - - - name: Skip – no changes in this subgraph - if: steps.detect.outputs.core_changed == 'false' && steps.detect.outputs.pkg_changed == 'false' - run: | - echo "🟢 No changes in ${{ matrix.subgraph }} — nothing to check." diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 0f465d8e..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Continuously check builds on every push and pull request - -name: Continuous Integration - -on: - push: - branches: - - '**' - tags-ignore: - - '*' - pull_request: - branches: - - '**' - - -jobs: - compile: - runs-on: ubuntu-22.04 - name: Compile - strategy: - matrix: - subgraph: - [ - 'bonds', - 'carbonmark', - 'protocol-metrics', - 'vesting', - 'user-carbon', - 'pairs', - 'celo-bridged-carbon', - 'ethereum-bridged-carbon', - 'polygon-digital-carbon', - ] - steps: - - name: Check out source repository - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install root dependencies - run: npm install - - name: Install workspace dependencies - run: npm install - working-directory: '${{ matrix.subgraph }}' - - # Generate code and check for uncommitted changes - # https://github.com/marketplace/actions/check-uncommitted-changes - - name: Prepare Manifest - if: matrix.subgraph == 'polygon-digital-carbon' || matrix.subgraph == 'carbonmark' - run: npm run prepare-matic - working-directory: '${{ matrix.subgraph }}' - - name: Generate Subgraph Code - run: npm run codegen - working-directory: '${{ matrix.subgraph }}' - - name: Check for uncommitted changes - id: check-changes - uses: mskri/check-uncommitted-changes-action@v1.0.1 - - name: Evaluate if there are changes - if: steps.check-changes.outputs.outcome == failure() - run: echo "There are uncommitted changes - execute 'npm run codegen' locally and commit the generated files!" - - - name: Build Subgraph - run: npm run build - working-directory: '${{ matrix.subgraph }}' - - name: Run Tests - if: matrix.subgraph == 'polygon-digital-carbon' || matrix.subgraph == 'carbonmark' || matrix.subgraph == 'pairs' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run test -d - working-directory: '${{ matrix.subgraph }}' diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml deleted file mode 100644 index 0e1a409e..00000000 --- a/.github/workflows/deploy-dev.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: Dev Deployment - -on: - push: - branches: - - dev - -jobs: - compile: - runs-on: ubuntu-latest - name: Deploy - strategy: - matrix: - subgraph: - [ - 'bonds', - 'carbonmark', - 'protocol-metrics', - 'vesting', - 'user-carbon', - 'pairs', - 'celo-bridged-carbon', - 'ethereum-bridged-carbon', - 'polygon-digital-carbon', - ] - steps: - - name: Check out source repository - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install root dependencies - run: npm install - - name: Install workspace dependencies - run: npm install - working-directory: ${{ matrix.subgraph }} - # Generate code and check for uncommitted changes - # https://github.com/marketplace/actions/check-uncommitted-changes - - name: Generate Subgraph Code - run: npm run codegen - working-directory: '${{ matrix.subgraph }}' - - - name: Check for uncommitted changes - id: check-changes - uses: mskri/check-uncommitted-changes-action@v1.0.1 - - - name: Evaluate if there are changes - if: steps.check-changes.outputs.outcome == failure() - run: echo "There are uncommitted changes - execute 'npm run codegen' locally and commit the generated files!" - - - name: Build Subgraph - run: npm run build - working-directory: '${{ matrix.subgraph }}' - - - name: Create Subgraph Name - id: create_subgraph_name - run: | - echo "short_sha=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT - - PREFIX="dev-" - - if [[ "${{ matrix.subgraph }}" =~ .*"-".*"-carbon".* ]] - then - echo "subgraph=${PREFIX}${{ matrix.subgraph }}" >> $GITHUB_OUTPUT - else - echo "subgraph=${PREFIX}klimadao-${{ matrix.subgraph }}" >> $GITHUB_OUTPUT - fi - env: - REF: ${{ github.ref }} - - name: Deploy Subgraph to Studio - run: ../node_modules/.bin/graph deploy --deploy-key ${{ secrets.SUBGRAPH_STUDIO_DEPLOY_KEY }} ${{ steps.create_subgraph_name.outputs.subgraph }} --version-label ${{ steps.create_subgraph_name.outputs.short_sha }} - working-directory: '${{ matrix.subgraph }}' diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e0e216a6..bcc928e1 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -38,7 +38,6 @@ jobs: with: fetch-depth: 0 fetch-tags: true - token: ${{ secrets.GH_ACCESS_TOKEN }} - name: Configure Git author run: | git config --global user.name "deploy-action"