Skip to content

Add GraalVM native release workflow and Homebrew tap distribution #23

@snytkine

Description

@snytkine

Summary

Add a GitHub Actions release workflow that compiles platform-specific GraalVM native binaries on every tagged release, uploads them as GitHub Release assets, and keeps a Homebrew tap formula up to date so users can install via brew install.


Goals

  • brew tap snytkine/tap && brew install api-tester-cli works on macOS (arm64 and x86_64)
  • Linux x86_64 binary available as a direct download from GitHub Releases
  • Releases are reproducible and automated — tagging v1.x.x kicks off the whole pipeline with no manual steps

Part 1 — GitHub Actions release workflow

Trigger

on:
  push:
    tags:
      - 'v*'

Only fires on version tags (e.g. v1.0.0). The existing maven.yml CI workflow continues to run on every push/PR to main for fast JVM builds and tests.

Matrix build

Three parallel jobs, one per target platform:

Matrix entry Runner Output binary name
macos-arm64 macos-latest api-tester-macos-arm64
macos-x86_64 macos-13 api-tester-macos-x86_64
linux-x86_64 ubuntu-latest api-tester-linux-x86_64

Each job:

  1. Checks out the repo at the tag
  2. Sets up GraalVM JDK 25 via graalvm/setup-graalvm@v1 (includes native-image tool)
  3. Runs ./mvnw clean -Pnative native:compile
  4. Renames the binary to the platform-specific name above
  5. Computes its SHA256 checksum and saves it to <name>.sha256
  6. Uploads both files as job artifacts

Release job (runs after all matrix jobs succeed)

  1. Creates (or updates) the GitHub Release for the tag using softprops/action-gh-release@v2
  2. Uploads all six files (3 binaries + 3 checksums) as release assets

Formula update job (runs after the release job)

  1. Checks out snytkine/homebrew-tap
  2. Reads the download URLs and SHA256 values from the release assets
  3. Rewrites Formula/api-tester-cli.rb with the new version, URLs, and checksums
  4. Opens a PR (or pushes directly to main) in homebrew-tap

Part 2 — Homebrew tap repository

Create a new public GitHub repository: snytkine/homebrew-tap

Formula skeleton: Formula/api-tester-cli.rb

class ApiTesterCli < Formula
  desc "CLI tool for executing HTTP API test suites defined in YAML"
  homepage "https://github.com/snytkine/api-tester-cli"
  version "1.0.0"
  license "Apache-2.0"

  on_macos do
    on_arm do
      url "https://github.com/snytkine/api-tester-cli/releases/download/v1.0.0/api-tester-macos-arm64"
      sha256 "<arm64-sha256>"
    end
    on_intel do
      url "https://github.com/snytkine/api-tester-cli/releases/download/v1.0.0/api-tester-macos-x86_64"
      sha256 "<x86_64-sha256>"
    end
  end

  def install
    binary = on_arm? ? "api-tester-macos-arm64" : "api-tester-macos-x86_64"
    bin.install binary => "api-tester"
  end

  test do
    system "#{bin}/api-tester", "--version"
  end
end

User installation

brew tap snytkine/tap
brew install api-tester-cli

# upgrade later
brew upgrade api-tester-cli

Part 3 — README badges and download section

Add to README.md:

  • CI badge (existing maven.yml)
  • Latest release badge
  • Installation instructions for macOS (Homebrew) and Linux (direct download + chmod +x)

Linux install example:

curl -L https://github.com/snytkine/api-tester-cli/releases/latest/download/api-tester-linux-x86_64 \
  -o api-tester && chmod +x api-tester && sudo mv api-tester /usr/local/bin/

Implementation notes

  • graalvm/setup-graalvm@v1 sets JAVA_HOME and PATH automatically; no manual JAVA_HOME prefix needed in workflow steps
  • GraalVM native compilation needs ~7 GB RAM; GitHub-hosted runners provide 7 GB on all three platforms — keep an eye on memory-intensive builds
  • native:compile reads src/main/resources/META-INF/native-image/ hints already present in the project; no additional AOT config should be required
  • The maven.yml workflow uses Temurin JDK 25 and should remain unchanged — it is the fast CI check; the new release workflow is the slow native build
  • Suggested workflow file name: .github/workflows/release.yml

Checklist

  • .github/workflows/release.yml created with matrix build (macOS arm64, macOS x86_64, Linux x86_64)
  • Each matrix job sets up GraalVM 25, builds native binary, renames it, and computes SHA256
  • Release job creates GitHub Release and uploads all binaries + checksums as assets
  • snytkine/homebrew-tap repository created with Formula/api-tester-cli.rb
  • Formula update step in release workflow rewrites formula and opens PR (or pushes) to homebrew-tap
  • README.md updated with installation instructions for macOS (Homebrew) and Linux (direct download)
  • End-to-end test: tag v0.0.1-test, verify all three binaries are built and attached to the release, verify brew install works on macOS arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions