From af86e747d77865f63b29f768cb1675153633bb7e Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Tue, 19 Nov 2024 12:28:42 -0300 Subject: [PATCH] ci: add release ci --- .github/workflows/ci.yaml | 32 ++++++++++++++++++++- README.md | 5 ++++ package.json | 3 +- subgraphs/cross-chain-governance/.releaserc | 4 +-- subgraphs/etherfi-promo/.releaserc | 4 +-- subgraphs/isolated-pools/.releaserc | 4 +-- subgraphs/protocol-reserve/.releaserc | 4 +-- subgraphs/venus-governance/.releaserc | 4 +-- subgraphs/venus/.releaserc | 4 +-- 9 files changed, 50 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8065c6cb..da08f0f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: "yarn" - name: Install deps @@ -144,3 +144,33 @@ jobs: run: | docker compose down -v docker system prune -f -a --volumes + + release: + runs-on: ubuntu-20.04 + needs: [unit-test, lint, integration-test-core-pool, integration-test-isolated-pools, integration-test-governance] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "yarn" + + - name: Install deps + run: yarn + + - name: Version subgraphs + env: + GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }} + GIT_AUTHOR_NAME: Venus Tools + GIT_AUTHOR_EMAIL: tools@venus.io + GIT_COMMITTER_NAME: Venus Tools + GIT_COMMITTER_EMAIL: tools@venus.io + run: | + yarn workspace @venusprotocol/cross-chain-governance-subgraph run semantic-release + yarn workspace @venusprotocol/etherfi-promo run semantic-release + yarn workspace @venusprotocol/isolated-pools-subgraph run semantic-release + yarn workspace @venusprotocol/protocol-reserve-subgraph run semantic-release + yarn workspace @venusprotocol/core-pool-subgraph run semantic-release + yarn workspace @venusprotocol/governance-subgraph run semantic-release diff --git a/README.md b/README.md index bbe2c33a..50f7a45a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,11 @@ createdb graph-node Also, you might want to make sure test assertions are not being made against a state that was previously mutated by other test runs. To avoid this scenario, you will want to also recreate your Postgres DB and restart your ipfs and eth node services. + +## Versioning / Deployments +Versioning is handled by semantic release based on formatted commits and the config defined in the `.releaserc` of each subgraph. +Branches with the `pre` prefix are versioned as pre-releases. + ## Debugging To query the indexing error use a graphql explorer like [GraphiQl](https://graphiql-online.com/graphiql) to query the graph node for the status of the graph. The endpoint for the hosted service is `https://api.thegraph.com/index-node/graphql`. diff --git a/package.json b/package.json index 72cf733a..4fc6b06d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "subgraphs", + "name": "@venusprotocol/subgraphs", "private": true, "version": "0.0.0", "repository": "https://github.com/VenusProtocol/subgraphs", @@ -13,6 +13,7 @@ ], "scripts": { "codegen": "yarn workspaces foreach run codegen", + "semantic-release": "yarn workspaces foreach run semantic-release", "build:docker": "yarn workspaces foreach run build:docker", "build:chapel": "yarn workspaces foreach run build:chapel", "build:bsc": "yarn workspaces foreach run build:bsc", diff --git a/subgraphs/cross-chain-governance/.releaserc b/subgraphs/cross-chain-governance/.releaserc index 1b8a54f1..e3bab54d 100644 --- a/subgraphs/cross-chain-governance/.releaserc +++ b/subgraphs/cross-chain-governance/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "pre-*", + "prerelease": "pre" } ] } \ No newline at end of file diff --git a/subgraphs/etherfi-promo/.releaserc b/subgraphs/etherfi-promo/.releaserc index 1b8a54f1..6a8a7a64 100644 --- a/subgraphs/etherfi-promo/.releaserc +++ b/subgraphs/etherfi-promo/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "test-*", + "prerelease": "pre" } ] } \ No newline at end of file diff --git a/subgraphs/isolated-pools/.releaserc b/subgraphs/isolated-pools/.releaserc index 1b8a54f1..6a8a7a64 100644 --- a/subgraphs/isolated-pools/.releaserc +++ b/subgraphs/isolated-pools/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "test-*", + "prerelease": "pre" } ] } \ No newline at end of file diff --git a/subgraphs/protocol-reserve/.releaserc b/subgraphs/protocol-reserve/.releaserc index 1b8a54f1..6a8a7a64 100644 --- a/subgraphs/protocol-reserve/.releaserc +++ b/subgraphs/protocol-reserve/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "test-*", + "prerelease": "pre" } ] } \ No newline at end of file diff --git a/subgraphs/venus-governance/.releaserc b/subgraphs/venus-governance/.releaserc index 1b8a54f1..6a8a7a64 100644 --- a/subgraphs/venus-governance/.releaserc +++ b/subgraphs/venus-governance/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "test-*", + "prerelease": "pre" } ] } \ No newline at end of file diff --git a/subgraphs/venus/.releaserc b/subgraphs/venus/.releaserc index 1b8a54f1..6a8a7a64 100644 --- a/subgraphs/venus/.releaserc +++ b/subgraphs/venus/.releaserc @@ -79,8 +79,8 @@ "name": "main" }, { - "name": "[!main]", - "prerelease": "pr" + "name": "test-*", + "prerelease": "pre" } ] } \ No newline at end of file