Skip to content

Commit

Permalink
ci: Add releases for x86_64 macOS (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
varungandhi-src authored Apr 10, 2023
1 parent 9e9cd72 commit 833bd67
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
name: 'Build and upload artifacts'
strategy:
matrix:
# TODO: Add macos-12 once
# https://github.com/github/roadmap/issues/528 is fixed
platform: ['ubuntu-20.04', 'windows-2022']
# NOTE: GitHub-hosted runners for macOS are x86_64 only
# https://github.com/github/roadmap/issues/528
platform: ['ubuntu-20.04', 'macos-12'] # , 'windows-2022']
config: ['dev', 'release']
runs-on: ${{ matrix.platform }}
env:
Expand Down
7 changes: 2 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependen

bazel_toolchain_dependencies()

load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
load("//:setup_llvm.bzl", "setup_llvm_toolchain")

llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "15.0.6",
)
setup_llvm_toolchain(name = "llvm_toolchain")

load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
Expand Down
28 changes: 28 additions & 0 deletions setup_llvm.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", grailbio_llvm_toolchain = "llvm_toolchain")

def setup_llvm_toolchain(name):
mapping = {
"linux-aarch64": {"version": "15.0.6", "triple": "aarch64-linux-gnu", "sha256": "8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec"},
"linux-x86_64": {"version": "15.0.6", "triple": "x86_64-linux-gnu-ubuntu-18.04", "sha256": "38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036"},
"darwin-arm64": {"version": "15.0.6", "triple": "arm64-apple-darwin21.0", "sha256": "32bc7b8eee3d98f72dd4e5651e6da990274ee2d28c5c19a7d8237eb817ce8d91"},
"darwin-x86_64": {"version": "15.0.7", "triple": "x86_64-apple-darwin21.0", "sha256": "d16b6d536364c5bec6583d12dd7e6cf841b9f508c4430d9ee886726bd9983f1c"},
"windows": {"version": "15.0.6", "sha256": "22e2f2c38be4c44db7a1e9da5e67de2a453c5b4be9cf91e139592a63877ac0a2", "url": "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/LLVM-15.0.6-win64.exe"},
}
llvm_versions, sha256, strip_prefix, urls = {}, {}, {}, {}
for (k, v) in mapping.items():
llvm_versions[k] = v["version"]
sha256[k] = v["sha256"]
if "url" in v:
urls[k] = [v["url"]]
else:
prefix = "clang+llvm-{version}-{triple}".format(version = v["version"], triple = v["triple"])
strip_prefix[k] = prefix
urls[k] = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/{prefix}.tar.xz".format(version = v["version"], prefix = prefix)]

grailbio_llvm_toolchain(
name = name,
llvm_versions = llvm_versions,
strip_prefix = strip_prefix,
urls = urls,
sha256 = sha256,
)

0 comments on commit 833bd67

Please sign in to comment.