Skip to content

Commit 9f2a54b

Browse files
amit-mominernest-nowackiwentzeldnolag
authored
Update protos submodule to point to cap-dev branch (#218)
* Bumped package.json for new chain integrations (#203) * Add ability to pre-release (#204) * Added Pharos Atlantic support * Add encodeCallMsg field-context errors and logTriggerConfig helper (#201) * Add encodeCallMsg field-context errors and logTriggerConfig helper - encodeCallMsg now wraps hexToBase64 errors with field name context - Add logTriggerConfig() helper for validated hex-to-base64 log trigger config - Add validateHexByteLength for address (20 bytes) and topic (32 bytes) validation - Add 17 new tests for encodeCallMsg error context and logTriggerConfig * fix test * fix linter --------- Co-authored-by: ernest-nowacki <ernest.nowacki@smartcontract.com> * remove node types and bun types from workflows (#199) * remove node types and bun types from workflows * Update comment * Expose console types through global and add examples that serve as test that this setup actually works * Add node modules restrictions * Add more restricted node APIs * Expose more apis through runtime * TS fixes * Fix prepare runtime * Add links to the docs * Update versions * Add node modules examples * Add documentation around workflow validation * Add tests and fixed bug caught up by the test * Set version for alpha * Restore 1.1.3 version * Simplify error messages * Alpha release 2 * Restore correct versions * Update version, add option to use user tsconfig * Small fixes * add option to do javy plugin pre-release (#207) * Merge pull request #208 from smartcontractkit/chore/bump-cl-protos Add new EVM mainnet and testnet chains * Update chain-selectors dependency (#210) * Updated chain-selectors dependency * Updated package.json version * Added hyperliquid mainnet and gnosis chiado support (#211) * Code improvements (#214) * Reproducible builds for a an OS (possibly not tied to arch) * Remove comment that wasn't needed * Fix generate chain selectors script (#216) * Updated protos submodule to point to cap-dev branch * Check types using workflow's `tsconfig` (#212) * Update ts to be checking at build time * running full-checks * Remove extra alias * Run bun-full checks with new docker support * Update actions in github workflows (#221) * Add CI to validate protos version on cap-dev branch (#217) * Added CI validation to ensure protos submodule points to cap-dev branch * Updated checkout action version * Moved validate-submodule CI to its own workflow * Moved permissions to job * Updated checkout action version --------- Co-authored-by: Ernest Nowacki <124677192+ernest-nowacki@users.noreply.github.com> Co-authored-by: De Clercq Wentzel <10665586+wentzeld@users.noreply.github.com> Co-authored-by: ernest-nowacki <ernest.nowacki@smartcontract.com> Co-authored-by: Ryan Tinianov <tinianov@live.com>
1 parent 38bc29d commit 9f2a54b

96 files changed

Lines changed: 4695 additions & 779 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
with:
1818
submodules: recursive
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020

2121
- name: Setup Bun
22-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
22+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
2323
with:
2424
bun-version: latest
2525

@@ -47,7 +47,7 @@ jobs:
4747

4848
steps:
4949
- name: Checkout code
50-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5151
with:
5252
submodules: recursive
5353
token: ${{ secrets.GITHUB_TOKEN }}
@@ -67,31 +67,55 @@ jobs:
6767
# Use bash or sh for this step, because zsh isn't set yet
6868
shell: bash {0}
6969

70-
# Install Rust + add wasm32-wasip1 target
71-
- name: Setup Rust (stable) with wasm target
72-
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
70+
# Match packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/rust-toolchain.toml (host cargo build step).
71+
- name: Setup Rust (1.85.0) with wasm target
72+
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
7373
with:
74-
toolchain: stable
74+
toolchain: 1.85.0
7575
target: wasm32-wasip1
7676
override: true
7777

7878
- name: Setup Bun
79-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
79+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
8080
with:
8181
bun-version: latest
8282

8383
- name: Cache Bun dependencies
84-
uses: actions/cache@v4
84+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
8585
with:
8686
path: ~/.bun/install/cache
8787
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
8888

89+
# Host cargo (compile-javy-sdk-plugin) + optional local plugin path; Docker build uses its own layers.
90+
- name: Cache cargo + Javy release binary cache
91+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
92+
with:
93+
path: |
94+
~/.cargo/registry
95+
~/.cargo/git
96+
~/.cache/javy
97+
key: ${{ runner.os }}-cre-plugin-v8.1.0-${{ hashFiles('packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/Cargo.lock', 'packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/rust-toolchain.toml', 'packages/cre-sdk-javy-plugin/scripts/build-plugin-local.sh', 'packages/cre-sdk-javy-plugin/scripts/print-javy-path-for-build.ts', 'packages/cre-sdk-javy-plugin/scripts/ensure-javy.ts', 'packages/cre-sdk-javy-plugin/Dockerfile') }}
98+
8999
- name: Install dependencies
90100
run: bun install --frozen-lockfile
91101

102+
# build:plugin-wasm uses Docker (same as default locally) so committed dist/*.wasm matches CI.
103+
# SKIP_DOCKER_IMAGE=1 is for machines without Docker only; it produces different bytes than the image.
92104
- name: Full checks
93105
run: bun full-checks
94106

107+
- name: Verify no uncommitted changes
108+
run: |
109+
if ! git diff --exit-code; then
110+
echo ""
111+
echo "=========================================="
112+
echo "Uncommitted file changes detected after full-checks!"
113+
echo "Run 'bun full-checks' locally and commit the resulting changes."
114+
echo "=========================================="
115+
exit 1
116+
fi
117+
shell: bash {0}
118+
95119
- name: Install CRE CLI
96120
run: |
97121
chmod +x scripts/setup-cre-cli.sh

.github/workflows/publish-cre-sdk-javy-plugin.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030
with:
3131
ref: ${{ github.event.inputs.tag || 'main' }}
3232
fetch-depth: 0
@@ -39,7 +39,7 @@ jobs:
3939
echo "Current commit short: $(git rev-parse --short HEAD)"
4040
4141
- name: Setup Bun
42-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
42+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
4343
with:
4444
bun-version: ${{ env.BUN_VERSION }}
4545

@@ -63,15 +63,24 @@ jobs:
6363
echo "JAVY_PLUGIN_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
6464
echo "Using javy plugin version from package.json: $CURRENT_VERSION"
6565
66+
# Detect pre-release tag from version (e.g. 1.2.0-alpha.1 → alpha)
67+
if [[ "$CURRENT_VERSION" =~ -([a-zA-Z]+) ]]; then
68+
NPM_TAG="${BASH_REMATCH[1]}"
69+
else
70+
NPM_TAG="latest"
71+
fi
72+
echo "NPM_DIST_TAG=$NPM_TAG" >> $GITHUB_ENV
73+
echo "npm dist-tag: $NPM_TAG"
74+
6675
- name: Publish CRE SDK Javy plugin package
6776
working-directory: packages/cre-sdk-javy-plugin
6877
run: |
69-
echo "Publishing @chainlink/cre-sdk-javy-plugin..."
78+
echo "Publishing @chainlink/cre-sdk-javy-plugin with dist-tag: $NPM_DIST_TAG..."
7079
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
7180
echo "DRY RUN: Would publish @chainlink/cre-sdk-javy-plugin"
72-
npm publish --dry-run --access public --verbose
81+
npm publish --dry-run --access public --tag "$NPM_DIST_TAG" --verbose
7382
else
74-
npm publish --access public --verbose
83+
npm publish --access public --tag "$NPM_DIST_TAG" --verbose
7584
fi
7685
7786
- name: Create release summary
@@ -106,7 +115,7 @@ jobs:
106115

107116
steps:
108117
- name: Setup Bun
109-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
118+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
110119
with:
111120
bun-version: ${{ env.BUN_VERSION }}
112121

.github/workflows/publish-cre-sdk.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout code
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434
with:
3535
ref: ${{ github.event.inputs.tag || 'main' }}
3636
fetch-depth: 0
@@ -55,7 +55,7 @@ jobs:
5555
echo "Current commit short: $(git rev-parse --short HEAD)"
5656
5757
- name: Setup Bun
58-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
58+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
5959
with:
6060
bun-version: ${{ env.BUN_VERSION }}
6161

@@ -78,6 +78,15 @@ jobs:
7878
echo "CRE_SDK_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
7979
echo "Using CRE SDK version from package.json: $CURRENT_VERSION"
8080
81+
# Detect pre-release tag from version (e.g. 1.1.3-alpha.1 → alpha)
82+
if [[ "$CURRENT_VERSION" =~ -([a-zA-Z]+) ]]; then
83+
NPM_TAG="${match[1]}"
84+
else
85+
NPM_TAG="latest"
86+
fi
87+
echo "NPM_DIST_TAG=$NPM_TAG" >> $GITHUB_ENV
88+
echo "npm dist-tag: $NPM_TAG"
89+
8190
- name: Build cre-sdk
8291
working-directory: packages/cre-sdk
8392
run: bun run build
@@ -91,12 +100,12 @@ jobs:
91100
- name: Publish cre-sdk package
92101
working-directory: packages/cre-sdk
93102
run: |
94-
echo "Publishing @chainlink/cre-sdk..."
103+
echo "Publishing @chainlink/cre-sdk with dist-tag: $NPM_DIST_TAG..."
95104
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
96105
echo "DRY RUN: Would publish @chainlink/cre-sdk"
97-
npm publish --dry-run --access public --verbose
106+
npm publish --dry-run --access public --tag "$NPM_DIST_TAG" --verbose
98107
else
99-
npm publish --access public --verbose
108+
npm publish --access public --tag "$NPM_DIST_TAG" --verbose
100109
fi
101110
102111
- name: Create release summary
@@ -105,14 +114,18 @@ jobs:
105114
echo "## 📦 Published CRE SDK Package" >> $GITHUB_STEP_SUMMARY
106115
echo "" >> $GITHUB_STEP_SUMMARY
107116
echo "- 📋 \`@chainlink/cre-sdk@$CRE_SDK_VERSION\`" >> $GITHUB_STEP_SUMMARY
117+
echo "- 🏷️ npm dist-tag: \`$NPM_DIST_TAG\`" >> $GITHUB_STEP_SUMMARY
108118
echo "- 📋 Published from: \`${{ github.event.inputs.tag || 'main' }}\`" >> $GITHUB_STEP_SUMMARY
109119
echo "- 🔗 Commit: \`$(git rev-parse --short HEAD)\`" >> $GITHUB_STEP_SUMMARY
110120
echo "" >> $GITHUB_STEP_SUMMARY
111121
112122
echo "### Installation" >> $GITHUB_STEP_SUMMARY
113123
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
114-
echo "# Using bun" >> $GITHUB_STEP_SUMMARY
115-
echo "bun add @chainlink/cre-sdk" >> $GITHUB_STEP_SUMMARY
124+
if [ "$NPM_DIST_TAG" = "latest" ]; then
125+
echo "bun add @chainlink/cre-sdk" >> $GITHUB_STEP_SUMMARY
126+
else
127+
echo "bun add @chainlink/cre-sdk@$NPM_DIST_TAG" >> $GITHUB_STEP_SUMMARY
128+
fi
116129
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
117130
echo "" >> $GITHUB_STEP_SUMMARY
118131
@@ -129,7 +142,7 @@ jobs:
129142

130143
steps:
131144
- name: Setup Bun
132-
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
145+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
133146
with:
134147
bun-version: ${{ env.BUN_VERSION }}
135148

@@ -138,14 +151,14 @@ jobs:
138151

139152
- name: Verify cre-sdk package installation
140153
run: |
141-
echo "Verifying @chainlink/cre-sdk can be installed..."
142-
bun add @chainlink/cre-sdk --dry-run
154+
echo "Verifying @chainlink/cre-sdk@$CRE_SDK_VERSION can be installed..."
155+
bun add @chainlink/cre-sdk@$CRE_SDK_VERSION --dry-run
143156
echo "✅ CRE SDK package verification successful"
144157
145158
- name: Verify CLI binary is available
146159
run: |
147160
echo "Installing package to test CLI binary..."
148-
bun add @chainlink/cre-sdk
161+
bun add @chainlink/cre-sdk@$CRE_SDK_VERSION
149162
150163
echo "Checking cre-compile command via bunx..."
151164
if bun x cre-compile --help >/dev/null 2>&1; then
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Validate Submodule
2+
permissions: {}
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
branches: [capabilities-development]
8+
push:
9+
branches: [capabilities-development]
10+
11+
jobs:
12+
validate-submodule:
13+
permissions:
14+
contents: read
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v6
19+
with:
20+
submodules: recursive
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Validate chainlink-protos points to capabilities-development
24+
run: |
25+
cd submodules/chainlink-protos
26+
SUBMODULE_COMMIT=$(git rev-parse HEAD)
27+
echo "Submodule commit: $SUBMODULE_COMMIT"
28+
29+
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
30+
echo "Shallow clone detected, fetching full history..."
31+
git fetch --unshallow origin
32+
fi
33+
git fetch origin capabilities-development
34+
35+
BRANCH_TIP=$(git rev-parse FETCH_HEAD)
36+
echo "capabilities-development tip: $BRANCH_TIP"
37+
38+
if git merge-base --is-ancestor "$SUBMODULE_COMMIT" "$BRANCH_TIP"; then
39+
echo "OK: Submodule commit $SUBMODULE_COMMIT is on the capabilities-development branch."
40+
else
41+
echo "::error::chainlink-protos submodule is at commit $SUBMODULE_COMMIT which is NOT on the capabilities-development branch."
42+
echo "Update the submodule to point to a commit from the capabilities-development branch."
43+
exit 1
44+
fi

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "submodules/chainlink-protos"]
22
path = submodules/chainlink-protos
33
url = https://github.com/smartcontractkit/chainlink-protos.git
4+
branch = capabilities-development

PUBLISHING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,29 @@ This would mean we're releasing a new version of the `@chainlink/cre-sdk` withou
5757
_Note: In `Use workflow from` field keep `main` selected. In the `git tag` field put the name of tag you created (should start with `v`, following our example it would be: `v1.0.8`)._
5858
9. Once the SDK is published cleanup the `relase-candidate-vx.y.z` branch (following our example we would need to delete the branch `release-candidate-v1.0.8`).
5959
10. **🎉 Congratulations, you have released the new version of the CRE SDK!**
60+
61+
## Pre-release (Alpha / Beta / RC)
62+
63+
The npm dist-tag is determined automatically from the version in `package.json`. Pre-release versions never overwrite the `latest` tag, so `bun add @chainlink/cre-sdk` always installs the last stable release.
64+
65+
| Version in `package.json` | npm dist-tag | Install command |
66+
|---------------------------|-------------|-----------------|
67+
| `1.1.3` | `latest` | `bun add @chainlink/cre-sdk` |
68+
| `1.1.3-alpha.1` | `alpha` | `bun add @chainlink/cre-sdk@alpha` |
69+
| `1.1.3-beta.1` | `beta` | `bun add @chainlink/cre-sdk@beta` |
70+
| `1.1.3-rc.1` | `rc` | `bun add @chainlink/cre-sdk@rc` |
71+
72+
### Publishing a pre-release
73+
74+
Follow the same steps as scenario 1 or 2 above, but use a pre-release version string:
75+
76+
1. Set version in `packages/cre-sdk/package.json` to e.g. `1.1.3-alpha.1`
77+
2. Create the release branch, tag (e.g. `v1.1.3-alpha.1`), and trigger the publish workflow as usual
78+
3. The workflow automatically detects the pre-release suffix and publishes with the correct dist-tag
79+
80+
### Promoting to stable
81+
82+
Once the pre-release has been validated:
83+
84+
1. Update `packages/cre-sdk/package.json` version to `1.1.3` (remove the pre-release suffix)
85+
2. Follow the normal release process — the workflow will publish with `--tag latest`

bun.lock

Lines changed: 5 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cre-sdk-examples/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@chainlink/cre-sdk-examples",
33
"private": true,
4-
"version": "1.1.2",
4+
"version": "1.4.0",
55
"type": "module",
66
"author": "Ernest Nowacki",
77
"license": "BUSL-1.1",
@@ -20,9 +20,7 @@
2020
"viem": "2.34.0",
2121
"zod": "3.25.76"
2222
},
23-
"devDependencies": {
24-
"@types/bun": "1.3.8"
25-
},
23+
"devDependencies": {},
2624
"engines": {
2725
"bun": ">=1.2.21"
2826
}

0 commit comments

Comments
 (0)