Skip to content

feat: Add automated VFS builds to releases #863

@corylanou

Description

@corylanou

Summary

Add automated VFS (SQLite loadable extension) builds to Litestream releases for:

  • linux/amd64
  • linux/arm64
  • darwin/amd64
  • darwin/arm64

Background

The VFS extension allows read-only access to Litestream replicas directly from SQLite. Currently, users must build it manually. Adding automated release builds will make this feature more accessible.

Why GoReleaser Won't Work

The VFS build requires a two-stage process:

  1. Go builds a C archive (-buildmode=c-archive)
  2. GCC/clang links the archive into a shared library (.so/.dylib)

GoReleaser cannot orchestrate this multi-step build, and cross-compiling CGO for macOS from Linux requires the macOS SDK which isn't available.

Proposed Approach

Add a new vfs-build job to release.yml using a matrix strategy:

Platform Runner Strategy
linux/amd64 ubuntu-latest Native
linux/arm64 ubuntu-latest Cross-compile with gcc-aarch64-linux-gnu
darwin/amd64 macos-13 Native Intel
darwin/arm64 macos-14 Native M1

The VFS jobs will:

  1. Wait for GoReleaser to complete (needs: goreleaser)
  2. Build VFS extensions using Makefile targets
  3. Upload artifacts to the existing release via gh release upload

Artifact Naming

litestream-vfs-{version}-{os}-{arch}.tar.gz

Contents:

  • Linux: litestream-vfs-linux-{arch}.so
  • macOS: litestream-vfs-darwin-{arch}.dylib

Files to Modify

  1. Makefile - Add VFS build targets for each platform
  2. .github/workflows/release.yml - Add vfs-build-linux and vfs-build-darwin jobs
  3. .goreleaser.yml - Update release notes template

Release Result

Single release containing all artifacts:

v0.x.x Release
├── litestream-v0.x.x-linux-amd64.tar.gz      (GoReleaser)
├── litestream-v0.x.x-darwin-arm64.tar.gz     (GoReleaser)
├── litestream_0.x.x_amd64.deb                (GoReleaser)
├── checksums.txt                              (GoReleaser)
├── litestream-vfs-v0.x.x-linux-amd64.tar.gz  (VFS job)
├── litestream-vfs-v0.x.x-linux-arm64.tar.gz  (VFS job)
├── litestream-vfs-v0.x.x-darwin-amd64.tar.gz (VFS job)
└── litestream-vfs-v0.x.x-darwin-arm64.tar.gz (VFS job)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions