Skip to content

Commit

Permalink
chore: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Mar 20, 2024
1 parent fa27f6d commit b57f191
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 50 deletions.
81 changes: 35 additions & 46 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,57 @@
name: Create Release

on:
push:
pull_request:
types:
- closed
branches:
- main

jobs:
release:
deploy:
name: DeploySubgraph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- uses: actions-ecosystem/action-get-merged-pull-request@v1
id: get-merged-pull-request
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Bump version and push tag
id: tag_version
uses: miguelfito/github-bump-and-tag-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions-ecosystem/action-release-label@v1
id: release-label
if: ${{ steps.get-merged-pull-request.outputs.title != null }}
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
labels: ${{ steps.get-merged-pull-request.outputs.labels }}

- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: ${{ steps.release-label.outputs.level != null }}
with:
semver_only: true
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
if: ${{ steps.release-label.outputs.level != null }}
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: ${{ steps.release-label.outputs.level }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
if: ${{ steps.bump-semver.outputs.new_version != null }}
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
text: ${{ steps.get-merged-pull-request.outputs.body }}
regex: '```release_note([\s\S]*)```'
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions-ecosystem/action-push-tag@v1
if: ${{ steps.bump-semver.outputs.new_version != null }}
with:
tag: ${{ steps.bump-semver.outputs.new_version }}
message: "${{ steps.bump-semver.outputs.new_version }}: PR #${{ steps.get-merged-pull-request.outputs.number }} ${{ steps.get-merged-pull-request.outputs.title }}"
- name: Install dependencies
run: yarn install --frozen-lockfile

- uses: actions/create-release@v1
if: ${{ steps.release-label.outputs.level == 'major' || steps.release-label.outputs.level == 'minor' }}
- name: Deploy to Holesky
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump-semver.outputs.new_version }}
release_name: ${{ steps.bump-semver.outputs.new_version }}
body: ${{ steps.regex-match.outputs.group1 }}

- uses: actions-ecosystem/action-create-comment@v1
if: ${{ steps.bump-semver.outputs.new_version != null }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.get-merged-pull-request.outputs.number }}
body: |
The new version [${{ steps.bump-semver.outputs.new_version }}](https://github.com/${{ github.repository }}/releases/tag/${{ steps.bump-semver.outputs.new_version }}) has been released :tada:
VERSION_TAG: ${{ steps.tag_version.outputs.new_tag }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: export DEPLOY_KEY=${{ env.DEPLOY_KEY }} && export VERSION_TAG=${{ env.VERSION_TAG }} && yarn deploy:holesky
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"npmClient": "npm",
"packages": ["subgraphs/**/*"],
"useWorkspaces": false,
"useWorkspaces": true,
"version": "independent"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"intel": "docker-compose --file intel.yaml up --build",
"codegen": "lerna run codegen",
"build": "lerna run build",
"build:local": "lerna run build:local",
"build:holesky": "lerna run build:holesky",
"deploy:holesky": "lerna run deploy:holesky",
"build:goerli": "lerna run build:goerli",
"build:mainnet": "lerna run build:mainnet",
"format:check": "prettier --check '*/**/*.{js,ts,yaml,yml,json}'",
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/chamber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"remove:local": "graph remove --node http://localhost:8020/ chamber --network localhost",
"deploy:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 chamber --version-label v0.0.1 --network localhost",
"build:holesky": "graph build subgraph.yaml --network holesky",
"deploy:holesky": "graph deploy --studio --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ loreum/loreum-registry-holesky subgraph.yaml --network holesky",
"deploy:holesky": "graph auth --studio $DEPLOY_KEY && graph deploy --studio loreum/loreum-registry-holesky subgraph.yaml --network holesky --version-label $VERSION_TAG",
"build:sepolia": "graph build subgraph.yaml --network sepolia",
"build:mainnet": "graph build subgraph.yaml --network mainnet",
"deploy:sepolia": "graph deploy --studio --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ loreum/loreum-registry-sepolia subgraph.yaml --network sepolia",
"deploy:mainnet": "graph deploy --product hosted-service --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ looksrare/aggregator subgraph.yaml --network mainnet",
"deploy:mainnet": "graph deploy --studio loreum/loreum-registry subgraph.yaml --network mainnet --version-label $VERSION_LABEL --access-token $ACCESS_TOKEN",
"deploy:studio": "graph codegen subgraph.yaml && graph build subgraph.yaml && graph deploy --studio chamber --network mainnet",
"test:lerna": "graph codegen subgraph.yaml && graph build subgraph.yaml && graph test -r"
}
Expand Down

0 comments on commit b57f191

Please sign in to comment.