Skip to content

chore: optimize go build workflow#115

Merged
daniel-cohere merged 1 commit into
mainfrom
daniel/optimize-go-build
Jun 5, 2026
Merged

chore: optimize go build workflow#115
daniel-cohere merged 1 commit into
mainfrom
daniel/optimize-go-build

Conversation

@daniel-cohere

@daniel-cohere daniel-cohere commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

This PR updates the Linux build process in the go-lib-release.yml workflow, replacing Docker-based builds with direct Rust compilation, and introduces caching for faster builds.

  • Linux Build Process Update:

    • Removed Docker-based build steps (docker/setup-qemu-action, docker/setup-buildx-action, and associated commands).
    • Replaced with direct Rust compilation using cargo build --release --features tkzrs.
    • Simplified artifact extraction and packaging by directly copying the compiled library and creating a tarball.
  • Caching for Faster Builds:

    • Added caching for cargo registry, cargo index, and cargo build to speed up subsequent builds.
    • Cache keys are based on the platform, architecture, and Cargo.lock file hash.
  • Runner Configuration:

    • Replaced docker_platform with runner in the matrix strategy.
    • Specified runs-on to use the matrix runner (${{ matrix.runner }}).
  • Darwin Build Caching:

    • Added similar caching steps for Darwin builds to improve performance.

Note

Medium Risk
Linux artifacts are produced differently than local make release-linux-* (still Docker-based), so CI vs developer parity should be verified for both architectures.

Overview
Optimizes the go library release workflow by replacing Linux Docker/QEMU cross-builds with native cargo build on matrix runners (ubuntu-24.04-arm for arm64, ubuntu-latest for x86_64), matching the existing Darwin job pattern.

Adds Cargo registry, git, and target caches on both Linux and Darwin jobs (keyed by platform and Cargo.lock) to speed repeat releases. Linux packaging now copies libcohere_melody.a from target/release and tars it locally instead of building via release/Dockerfile and extracting from a container.

Reviewed by Cursor Bugbot for commit c7d9257. Bugbot is set up for automated code reviews on this repo. Configure here.

@daniel-cohere
daniel-cohere requested a review from a team as a code owner June 5, 2026 19:56
@daniel-cohere
daniel-cohere merged commit d06cab3 into main Jun 5, 2026
21 checks passed
@daniel-cohere
daniel-cohere deleted the daniel/optimize-go-build branch June 5, 2026 20:05
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.

2 participants