Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
ci: ci integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dehypnosis committed May 2, 2024
1 parent e7eb76f commit b8c9f56
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 236 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/CI.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: dev-release
on:
push:
branches:
- dev

# allow manual dispatch on action tab
workflow_dispatch:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
the-graph-deploy-seidev:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-main-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-main-
- name: Git clone the repository
uses: actions/checkout@v4

- run: yarn install --prefer-offline
- run: echo "./node_modules/.bin" >> $GITHUB_PATH
- run: graph codegen --output-dir src/types/ && graph build
- run: graph auth --studio ${{ secrets.THEGRAPH_SEIDEV_AUTH_KEY }} && graph deploy --studio encryptx-miro-seidev
63 changes: 63 additions & 0 deletions .github/workflows/prd-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: prd-release
on:
push:
tags:
- 'v*'

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
check-current-branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.check_step.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get current branch
id: check_step
# 1. Get the list of branches ref where this tag exists
# 2. Remove 'origin/' from that result
# 3. Put that string in output
# => We can now use function 'contains(list, item)''
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch="$(echo ${raw//origin\//} | tr -d '\n')"
echo "{name}=branch" >> $GITHUB_OUTPUT
echo "Branches where this tag exists : $branch."
the-graph-deploy:
runs-on: ubuntu-latest
# Wait for check step to finish
needs: check-current-branch
# only run if tag is present on branch 'main'
if: contains(${{ needs.check.outputs.branch }}, 'main')`

# it is required for passing AWS IAM policy
environment: prod

steps:
- uses: actions/setup-node@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-main-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-main-
- name: Git clone the repository
uses: actions/checkout@v4

- run: yarn install
- run: graph codegen && graph build && graph auth --studio ${{ runner.os }}
41 changes: 41 additions & 0 deletions .github/workflows/stg-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: stg-release
on:
push:
branches:
- main
tags-ignore:
- 'v*'

# allow manual dispatch on action tab
workflow_dispatch:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
the-graph-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-main-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-main-
- name: Git clone the repository
uses: actions/checkout@v4

- run: yarn install

- name: TheGraph build
run: graph codegen && graph build

- name: TheGraph deploy
run: graph auth --studio ${{ secrets.THEGRAPH_SEIDEV_AUTH_KEY }} && graph deploy --studio encryptx-miro-seidev
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ build/
node_modules/
src/types/
.DS_STORE
yarn-error.log
yarn-error.log
generated/
.vscode
.idea
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

63 changes: 0 additions & 63 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/v3-subgraph.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specVersion: 0.0.4
description: Uniswap is a decentralized protocol for automated token exchange on Ethereum.
repository: https://github.com/Uniswap/uniswap-v3-subgraph
description: https://github.com/encrypt-X/miro-uniswap-v3-subgraph
repository: https://github.com/encrypt-X/miro-uniswap-v3-subgraph
schema:
file: ./schema.graphql
features:
Expand Down
Loading

0 comments on commit b8c9f56

Please sign in to comment.