diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..90a2d84 --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,68 @@ +name: Create Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions-ecosystem/action-get-merged-pull-request@v1 + id: get-merged-pull-request + 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 }} + 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 + + - 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 }} + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex-match + if: ${{ steps.bump-semver.outputs.new_version != null }} + with: + text: ${{ steps.get-merged-pull-request.outputs.body }} + regex: '```release_note([\s\S]*)```' + + - 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 }}" + + - uses: actions/create-release@v1 + if: ${{ steps.release-label.outputs.level == 'major' || steps.release-label.outputs.level == 'minor' }} + 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: diff --git a/lerna.json b/lerna.json index d09e52d..e5f4b32 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { - "npmClient": "yarn", + "npmClient": "npm", "packages": ["subgraphs/**/*"], - "useWorkspaces": true, + "useWorkspaces": false, "version": "independent" } \ No newline at end of file diff --git a/subgraphs/chamber/networks.json b/subgraphs/chamber/networks.json index fd7e8c2..91f3e8e 100644 --- a/subgraphs/chamber/networks.json +++ b/subgraphs/chamber/networks.json @@ -4,5 +4,11 @@ "address": "0x46A49D4391F2F220D3661b2a2BFe4b306EE18845", "startBlock": 5433794 } + }, + "holesky": { + "Registry": { + "address": "0x5ed9315ab0274B0C546b71ed5a7ABE9982FF1E8D", + "startBlock": 1175645 + } } } diff --git a/subgraphs/chamber/package.json b/subgraphs/chamber/package.json index 550b00c..7036ed3 100644 --- a/subgraphs/chamber/package.json +++ b/subgraphs/chamber/package.json @@ -14,6 +14,8 @@ "create:local": "graph create --node http://localhost:8020/ chamber --network localhost", "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", "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", diff --git a/subgraphs/chamber/subgraph.yaml b/subgraphs/chamber/subgraph.yaml index b2bae96..9a33bbb 100644 --- a/subgraphs/chamber/subgraph.yaml +++ b/subgraphs/chamber/subgraph.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: Registry - network: sepolia + network: holesky source: abi: Registry - address: "0x46A49D4391F2F220D3661b2a2BFe4b306EE18845" - startBlock: 5281759 + address: "0x5ed9315ab0274B0C546b71ed5a7ABE9982FF1E8D" + startBlock: 1175645 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -30,7 +30,7 @@ dataSources: templates: - kind: ethereum name: Chamber - network: sepolia + network: holesky source: abi: Chamber mapping: