Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2762167
add release and artifact upload to ci, separate testing
vicentevieytes Sep 2, 2025
aa3a17a
fix workflow path on detect changes
vicentevieytes Sep 2, 2025
fd5f4bc
try fix for error on contracts test
vicentevieytes Sep 2, 2025
03b3d53
revert contracts-test change
vicentevieytes Sep 2, 2025
eba6ce9
try testing in the build workflow
vicentevieytes Sep 2, 2025
aefcaf7
delete contracts-test, rename contracts-build-test-release
vicentevieytes Sep 2, 2025
8d0082b
add flag to manually create the release on workflow dispatch
vicentevieytes Sep 2, 2025
9aed937
remove whitespace
vicentevieytes Sep 2, 2025
db259d3
rename to previous name to test workflow_dispatch, fix missing title
vicentevieytes Sep 2, 2025
bd099cb
change name on detect changes
vicentevieytes Sep 2, 2025
19e59f8
rename back to contracts-build-test.yml
vicentevieytes Sep 2, 2025
3e7567f
move permissions to the top of the job definition
vicentevieytes Sep 2, 2025
55c2152
make artifact and release names match
vicentevieytes Sep 2, 2025
53027b0
filter out examples from release
vicentevieytes Sep 2, 2025
ea83710
fix compile error on offramp test
vicentevieytes Sep 2, 2025
3382975
Merge branch 'main' into vv/publish-contracts-build
vicentevieytes Sep 3, 2025
e799078
separate build and test workflows
vicentevieytes Sep 4, 2025
ee7ebd3
build tarball from the nix pkg output
vicentevieytes Sep 4, 2025
8bb17c2
add permissions on test workflow
vicentevieytes Sep 4, 2025
4c62b88
join workflows back onto only one file
vicentevieytes Sep 5, 2025
4049efe
leave original workflow untouched, add custom workflow only for this …
vicentevieytes Sep 8, 2025
2ff1dfe
fix incorrect triggers for workflow
vicentevieytes Sep 8, 2025
02c031c
fix wrong indentation on workflow
vicentevieytes Sep 8, 2025
c34d87c
fix yml format
vicentevieytes Sep 8, 2025
24d935d
Merge branch 'main' of github.com:smartcontractkit/chainlink-ton into…
vicentevieytes Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/contracts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Install Nix
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31
with:
Expand All @@ -23,7 +22,6 @@ jobs:
run: |
pushd contracts
nix develop .#contracts -c yarn && yarn build

- name: Run tests
run: |
pushd contracts
Expand All @@ -40,6 +38,5 @@ jobs:
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Run build
run: nix build -v .#contracts
115 changes: 115 additions & 0 deletions .github/workflows/contracts-publish-compiled-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: TON - Publish contract artifacts release

# This is a custom temporary solution to get the contract build artifacts on other repos and workflows

permissions:
contents: read

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
inputs:
create_release:
description: "Publish a GitHub release on this manual run?"
type: boolean
default: false
required: false
sha:
description: "Commit SHA to build/release (optional)"
type: string
required: false

jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
ton_changes: ${{ steps.changes.outputs.ton_changes }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Detect changes
id: changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
list-files: "shell"
filters: |
ton_changes:
- 'contracts/**'
- '.github/workflows/contracts-build.yml'

publish:
name: Build Nix pkg and publish tarball
needs: [ changes ]
if: ${{ needs.changes.outputs.ton_changes == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0

- name: Get Long and Short SHAs
id: get_sha
run: |
set -euo pipefail
TARGET_SHA="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.sha != '' && github.event.inputs.sha || github.sha }}"
FULL_SHA="$(git rev-parse "${TARGET_SHA}")"
{
echo "short_sha=${FULL_SHA:0:12}"
echo "full_sha=${FULL_SHA}"
} >> "$GITHUB_OUTPUT"

- name: Install Nix
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build contracts (Nix) and capture out path
id: nix_build
run: |
set -euo pipefail
OUT_PATH="$(nix build --print-out-paths .#contracts)"
echo "out_path=${OUT_PATH}" >> "$GITHUB_OUTPUT"
echo "Nix out path: ${OUT_PATH}"

- name: Package from Nix build directory
id: package
run: |
set -euo pipefail
mkdir -p dist
TAR_NAME="ton-contracts-build-${{ steps.get_sha.outputs.short_sha }}.tar.gz"
BUILD_DIR="${{ steps.nix_build.outputs.out_path }}/lib/node_modules/@chainlink/contracts-ton/build"
test -d "${BUILD_DIR}" # hard fail if layout changes
tar -C "${BUILD_DIR}" \
--exclude="examples.*" \
-czf "dist/${TAR_NAME}" .
echo "tar_path=dist/${TAR_NAME}" >> "$GITHUB_OUTPUT"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ton-contracts-build-${{ steps.get_sha.outputs.short_sha }}
path: ${{ steps.package.outputs.tar_path }}
if-no-files-found: error
retention-days: 14

- name: Publish Release
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true') }}
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ton-contracts-build-${{ steps.get_sha.outputs.short_sha }}
target_commitish: ${{ steps.get_sha.outputs.full_sha }}
name: TON Contracts Build (${{ steps.get_sha.outputs.short_sha }})
draft: false
prerelease: false
files: |
${{ steps.package.outputs.tar_path }}

2 changes: 1 addition & 1 deletion contracts/tests/ccip/OffRamp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ describe('OffRamp', () => {

// Deploy test receiver
{
let code = await compile('Receiver')
let code = await compile('examples.receiver')
receiver = blockchain.openContract(ExampleReceiver.create(code, offRamp.address))
const result = await receiver.sendDeploy(deployer.getSender(), toNano('10'))
expect(result.transactions).toHaveTransaction({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('MerkleMultiProofTests', () => {
beforeEach(async () => {
blockchain = await Blockchain.create()

let code = await compile('MerkleProof')
let code = await compile('examples.MerkleProof')
let data: MerkleMultiProofCalculatorStorage = {
id: 1,
root: 0n, // Initial root, will be updated on deploy
Expand Down
2 changes: 1 addition & 1 deletion contracts/tests/libraries/ocr/MultiOCR3Base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('OCR3Base Tests', () => {
const hashedReport = hashReport(report, { configDigest, padding: 0n, sequenceBytes })

beforeAll(async () => {
code = await compile('OCR3Base')
code = await compile('examples.OCR3Base')
blockchain = await Blockchain.create()

deployer = await blockchain.treasury('deployer')
Expand Down