Skip to content

build: add release and artifact upload to contracts build CI#146

Merged
krebernisak merged 25 commits into
mainfrom
vv/publish-contracts-build
Sep 8, 2025
Merged

build: add release and artifact upload to contracts build CI#146
krebernisak merged 25 commits into
mainfrom
vv/publish-contracts-build

Conversation

@vicentevieytes
Copy link
Copy Markdown
Collaborator

@vicentevieytes vicentevieytes commented Sep 2, 2025

Motivation
Updates the TON - Contracts workflow to publish a release with the build artifacts after merging to main.
Example: https://github.com/smartcontractkit/chainlink-ton/releases/tag/ton-contracts-build-3e7567f120be

Description
The workflow now only runs when there are changes to the contracts/** files and filters out artifacts compiled with the example prefix.

  • Build the contracts
  • Run the unit tests
  • Packages the build output of the contracts and compresses it to a .zip file
  • Uploads as a gha artifact for the PR on every run (last 14 days, for debugging and testing)
  • Uploads as a gh release tagged with the sha when merged to main
  • Uploads as gh release on workflow_dispatch where you can set the commit sha manually

Comment thread .github/workflows/contracts-test.yml Fixed
Comment thread .github/workflows/contracts-test.yml Fixed
Comment thread .github/workflows/contracts-test.yml Fixed
@vicentevieytes vicentevieytes changed the title dev: add release and artifact upload to contracts build CI build: add release and artifact upload to contracts build CI Sep 2, 2025
@vicentevieytes vicentevieytes marked this pull request as ready for review September 2, 2025 16:27
Copilot AI review requested due to automatic review settings September 2, 2025 16:27
@vicentevieytes vicentevieytes requested a review from a team as a code owner September 2, 2025 16:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the existing contracts build workflow with an enhanced version that adds artifact packaging and release functionality. The new workflow builds contracts, runs tests, packages the output, and creates GitHub releases for main branch commits.

  • Replaced the simple build workflow with a comprehensive build-test-release pipeline
  • Added change detection to optimize CI runs by only executing when contracts or workflow files change
  • Integrated artifact upload and GitHub release creation with SHA-based tagging

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/contracts-build.yml Removes the original simple build workflow
.github/workflows/contracts-build-test-release.yml Adds new comprehensive workflow with change detection, packaging, and release functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread .github/workflows/contracts-build-test-release.yml Outdated
Comment thread .github/workflows/contracts-build-test-release.yml Outdated
@vicentevieytes vicentevieytes marked this pull request as draft September 2, 2025 16:29
Comment thread .github/workflows/contracts-build-test-release.yml
Comment thread .github/workflows/contracts-build-test.yml
@vicentevieytes vicentevieytes marked this pull request as ready for review September 2, 2025 17:32
patricios-space
patricios-space previously approved these changes Sep 2, 2025
Comment thread .github/workflows/contracts-build-test.yml Outdated
Comment thread .github/workflows/contracts-build-test.yml Outdated
name: TON Contracts Build (${{ steps.get_sha.outputs.short_sha }})
draft: false
prerelease: false
files: |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we actually need this?

Can't we just:

  • During active development, run TON_CONTRACTS_DIR=$(nix build 'git+https://github.com/smartcontractkit/chainlink-ton#contracts' --print-out-paths) will get you the latest from anywhere (e.g., core repo, cld repo)
  • Once we have a stable version, we make a release, and pin it where we need it TON_CONTRACTS_DIR=$(nix build 'git+https://github.com/smartcontractkit/chainlink-ton?ref=v0.1.1#contracts' --print-out-paths)

Not sure why we need custom releases on every commit for this.

Copy link
Copy Markdown
Collaborator Author

@vicentevieytes vicentevieytes Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree this is not the cleanest

Comment thread .github/workflows/contracts-build-test.yml Outdated
Comment thread .github/workflows/contracts-test.yml Fixed
Comment thread .github/workflows/contracts-test.yml Fixed
Comment thread .github/workflows/contracts-build.yml Outdated
Copy link
Copy Markdown
Collaborator

@krebernisak krebernisak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@krebernisak krebernisak merged commit 374a5ff into main Sep 8, 2025
26 checks passed
@krebernisak krebernisak deleted the vv/publish-contracts-build branch September 8, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants