Skip to content

Commit

Permalink
Build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
thii committed Apr 23, 2021
1 parent 48ced2c commit aac17fc
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: bazel build //Libraries:xcbuild
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bazel-bin/Libraries/xcbuild.tar.xz
asset_name: xcbuild.tar.xz
asset_content_type: application/x-xz
14 changes: 14 additions & 0 deletions Libraries/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")

pkg_tar(
name = "xcbuild",
srcs = [
"//Libraries/acdriver:actool",
"//Libraries/plist:PlistBuddy",
"//Libraries/plist:plutil",
"//Libraries/xcdriver:xcodebuild",
"//Libraries/xcsdk:xcode-select",
"//Libraries/xcsdk:xcrun",
],
extension = "tar.xz",
)
10 changes: 10 additions & 0 deletions Libraries/xcdriver/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")

cc_library(
name = "xcdriver",
srcs = glob(["Sources/**/*.cpp"]),
Expand All @@ -23,3 +25,11 @@ cc_binary(
srcs = ["Tools/xcbuild.cpp"],
deps = [":xcdriver"],
)

copy_file(
name = "xcodebuild_bin",
src = ":xcbuild",
out = "xcodebuild",
allow_symlink = True,
visibility = ["//visibility:public"],
)
22 changes: 22 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@ http_archive(
"https://github.com/antirez/linenoise/archive/97d2850af13c339369093b78abe5265845d78220.tar.gz",
],
)

http_archive(
name = "bazel_skylib",
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
],
)

http_archive(
name = "rules_pkg",
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
],
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

0 comments on commit aac17fc

Please sign in to comment.