-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: verify bindings and auto publish packages on tag release (#130)
* feat: verify bindings instead of generating them * chore: implement build-go-contract-bindings * chore: add bun lockfile * feat: add bindings go module * chore: move go module * chore: tidy go module generation * feat: add ts bindings * chore: update workflow * chore: generate all go bindings * feat: auto update registries on tag releases * bug: fix event name * bug: add release environment to regestries job * bug: fix linter dependencies * bug: remove package-lock * bug: replace node with bun in linter ci
- Loading branch information
Showing
40 changed files
with
4,256 additions
and
3,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Validate Bindings | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-bindings: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: "recursive" | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21.3" | ||
|
||
- name: Setup Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Install ABIGen | ||
run: | | ||
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.13.5 | ||
- name: Install Bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Generate Bindings | ||
run: | | ||
bun install --frozen-lockfile | ||
bun run build | ||
- name: Check for Go Bindings Changes | ||
run: | | ||
if [ $(git status --porcelain | sed 's/^...//' | grep bindings/ | wc -l) -ne 0 ]; then | ||
echo "Changes in Go Bindings" | ||
echo $(git status --porcelain | sed 's/^...//' | grep bindings/) | ||
exit 1 | ||
fi | ||
- name: Check for TypeScript Bindings Changes | ||
run: | | ||
if [ $(git status --porcelain | sed 's/^...//' | grep src/evm/contracts/ | wc -l) -ne 0 ]; then | ||
echo "Changes in TypeScript Bindings" | ||
echo $(git status --porcelain | sed 's/^...//' | grep src/evm/contracts/) | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: "recursive" | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Check contract sizes | ||
run: forge build --sizes --deny-warnings | ||
|
||
- name: Tests | ||
run: forge test | ||
|
||
- name: Save compiled contracts and ABIs | ||
if: success() | ||
run: | | ||
mkdir -p artifacts | ||
cp -r out/Dispatcher.sol/Dispatcher.json artifacts/ | ||
cp -r out/UniversalChannelHandler.sol/UniversalChannelHandler.json artifacts/ | ||
cp -r out/Mars.sol/Mars.json artifacts/ | ||
cp -r out/Earth.sol/Earth.json artifacts/ | ||
cp -r out/Moon.sol/Moon.json artifacts/ | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compiled-contracts | ||
path: artifacts | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: artifacts | ||
environment: release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: compiled-contracts | ||
path: ./artifacts | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: artifacts/** | ||
generate_release_notes: true | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
|
||
registries: | ||
runs-on: ubuntu-latest | ||
needs: release | ||
environment: release | ||
steps: | ||
- name: Get Latest Version | ||
id: version | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
repository: ${{ github.repository }} | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21.3" | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22.3.0" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Update NPM Registry | ||
run: | | ||
npm ci | ||
npm publish --provenance --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Update Go Registry | ||
run: | | ||
( cd ./bindings && \ | ||
GOPROXY=proxy.golang.org go list \ | ||
-m github.com/open-ibc/vibc-core-smart-contracts/bindings@${{ steps.version.outputs.release }} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ src/contracts.template.ts | |
forge-cache/ | ||
|
||
node_modules | ||
package-lock.json | ||
.env | ||
coverage | ||
coverage.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Package bindings defines the go bindings for the vibc-core-smart-contracts | ||
// EVM contract definitions. These allow for interaction in go with the contracts. | ||
package bindings |
Oops, something went wrong.