Skip to content

Aristide021/SwiftSyntaxBinaries

Repository files navigation

SwiftSyntaxBinaries

This repository automatically tracks and builds XCFramework releases corresponding to official apple/swift-syntax tags. Each release provides a pre-built XCFramework that can be easily integrated into Swift packages or Xcode projects.

Overview

  • GitHub Actions workflow automatically tracks new SwiftSyntax releases and builds corresponding XCFrameworks.
  • Runs weekly with a 2-week cooldown period after each release to avoid excessive builds.
  • Also supports manual triggering with specific SwiftSyntax tags.
  • Supports macOS (Universal: arm64 + x86_64).
  • Linux support coming August 2025 - Static libraries with Swift modules.
  • Each release includes a zipped XCFramework and its checksum for use as a binary target.

Usage

macOS (Available Now)

To use a pre-built SwiftSyntax XCFramework in your Swift package:

.binaryTarget(
    name: "SwiftSyntaxWrapper",
    url: "https://github.com/ARISTIDE021/SwiftSyntaxBinaries/releases/download/<TAG>/SwiftSyntax.xcframework.zip",
    checksum: "<CHECKSUM>"
)

Replace <TAG> and <CHECKSUM> with the release tag and checksum from the corresponding release.

Linux (Coming August 2025)

Linux static libraries will be available as .tar.gz archives containing:

  • lib/libSwiftSyntaxWrapper.a - Static library
  • include/SwiftSyntaxWrapper.swiftmodule/ - Swift module interfaces

Usage will be:

# Download and extract
wget https://github.com/ARISTIDE021/SwiftSyntaxBinaries/releases/download/<TAG>/SwiftSyntax-linux.tar.gz
tar -xzf SwiftSyntax-linux.tar.gz

# Build your project
swift build -Xlinker -L./SwiftSyntax-linux/lib -Xlinker -lSwiftSyntaxWrapper

Build Process

Automatic Builds

  1. The workflow runs weekly on Mondays to check for new SwiftSyntax releases.
  2. If a new release is found and we're not in a cooldown period, it proceeds to build.
  3. Cooldown period: 2 weeks after any release to prevent excessive builds.

Manual Builds

  1. The workflow can be triggered manually with a specific SwiftSyntax tag.
  2. Manual builds bypass the cooldown period.

Build Steps

  1. The build script clones the specified tag from apple/swift-syntax.
  2. Builds are performed for macOS (arm64, x86_64) using swift build via a temporary wrapper package.
  3. An XCFramework is created from the resulting static libraries and module files.
  4. The XCFramework is zipped and its checksum is computed.
  5. The zipped framework and checksum are attached to a GitHub release matching the tag.

License

MIT License. See LICENSE for details.

About

Automated builds of pre-compiled SwiftSyntax XCFrameworks (macOS universal) to speed up Swift Macro project builds via binary dependencies.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors