Repository navigation
Build and Release
TKS uses GitHub Actions for automated multi-platform builds and releases. Two workflows are active:
| Workflow | File | Trigger |
|---|---|---|
| Build TKS Chain Node | .github/workflows/build-release.yml |
Push to v* tag, manual |
| TKS Node Release | .github/workflows/release.yml |
Push to v* tag, manual |
Binaries are built for 5 platform/architecture targets using native runners (no cross-compilation):
| Platform | Architecture | Runner | Rust Target |
|---|---|---|---|
| macOS | Apple Silicon (arm64) | macos-14 |
aarch64-apple-darwin |
| macOS | Intel (x86_64) | macos-13 |
x86_64-apple-darwin |
| Linux | x86_64 | ubuntu-22.04 |
x86_64-unknown-linux-gnu |
| Linux | ARM64 | ubuntu-22.04-arm |
aarch64-unknown-linux-gnu |
| Windows | x86_64 | windows-2022 |
x86_64-pc-windows-msvc |
Native ARM64 runners are used for Linux arm64 to avoid cross-compilation complexity.
The toolchain is pinned via rust-toolchain.toml in the repository root:
[toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown"]
components = ["rust-src"]The CI additionally installs the platform's native target:
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown,${{ matrix.target }}
components: rust-srcsudo apt-get install -y \
build-essential pkg-config libssl-dev \
clang libclang-dev protobuf-compilerHOMEBREW_NO_REQUIRE_TAP_TRUST=1 brew install protobuf llvm
export LIBCLANG_PATH="$(brew --prefix llvm)/lib"- LLVM installed via Chocolatey (
choco install llvm) -
protocinstalled viaarduino/setup-protoc@v3GitHub Action LIBCLANG_PATH=C:\Program Files\LLVM\bin
The runtime is compiled to both native and WASM. The WASM build is handled automatically by substrate-wasm-builder as part of cargo build.
Key environment variable for CI:
WASM_BUILD_RUSTFLAGS: "-C link-arg=--allow-undefined"This allows rust-lld (Rust ≥ 1.88) to treat Substrate host functions (ext_storage_*, ext_hashing_*, etc.) as WASM imports resolved at runtime by the host environment.
- Ensure all changes are merged to
main - Create and push a version tag:
git tag v0.2.0
git push origin v0.2.0- GitHub Actions automatically:
- Builds all 5 platform binaries
- Packages each binary (
.tar.gzfor Linux/macOS,.zipfor Windows) - Generates
SHA256SUMS.txt - Creates a GitHub Release with all artifacts attached
- Includes operator scripts (
start-node.sh,install.sh, etc.)
Releases follow Semantic Versioning (v{MAJOR}.{MINOR}.{PATCH}).
| Component | Description |
|---|---|
| MAJOR | Breaking changes to chain spec or runtime API |
| MINOR | New features, backward-compatible |
| PATCH | Bug fixes, CI changes |
Cargo build caches are keyed per-target with the Cargo.lock hash:
key: ${{ matrix.target }}-cargo-v3-${{ hashFiles('**/Cargo.lock') }}This ensures:
- Cache hits when
Cargo.lockhasn't changed - Automatic cache invalidation on dependency updates
- No stale artifacts between versions
# Standard release build
cargo build --release
# Build only the runtime (WASM)
cargo build --release -p tks-runtime
# Build only the node binary
cargo build --release -p tks-chain-node
# Run tests
cargo test --workspace
# Check without building
cargo check --workspace
# Format code
cargo fmt --all
# Lint
cargo clippy --workspace -- -D warnings# Download binary and checksum file
curl -LO https://github.com/TokenKickstarter/tokenkickstarter-node/releases/latest/download/tks-chain-node-linux-x86_64-v0.1.0.tar.gz
curl -LO https://github.com/TokenKickstarter/tokenkickstarter-node/releases/latest/download/SHA256SUMS.txt
# Verify
sha256sum --check --ignore-missing SHA256SUMS.txt