Skip to content

Commit

Permalink
WIP: Setup build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewCarlson committed Jul 30, 2023
1 parent 2794c51 commit 7ed8d1a
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 2 deletions.
137 changes: 137 additions & 0 deletions .github/workflows/build-lexbor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Build and Release Lexbor Binaries

on:
push:
branches:
- drew/build-workflow

jobs:
build-macos-arm64:
name: Build macos arm64
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recurse'

- name: Build Lexbor
run: |
cd lexbor
mkdir build && mkdir install
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/macos-arm64.cmake -DCMAKE_INSTALL_PREFIX=../install
make
make install
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: macos-arm64-binaries
path: |
lexbor/install/include
lexbor/install/lib
build-macos-x64:
name: Build macos x64
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recurse'

- name: Build Lexbor
run: |
cd lexbor
mkdir build && mkdir install
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/macos-x64.cmake -DCMAKE_INSTALL_PREFIX=../install
make
make install
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: macos-x64-binaries
path: |
lexbor/install/include
lexbor/install/lib
build-ios-arm64:
name: Build iOS arm64
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recurse'

- name: Build Lexbor
run: |
cd lexbor
mkdir build && mkdir install
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/ios-arm64.cmake -DCMAKE_INSTALL_PREFIX=../install
make
make install
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: ios-arm64-binaries
path: |
lexbor/install/include
lexbor/install/lib
build-ios-x64:
name: Build iOS x64
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recurse'

- name: Build Lexbor
run: |
cd lexbor
mkdir build && mkdir install
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/ios-x64.cmake -DCMAKE_INSTALL_PREFIX=../install
make
make install
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: ios-x64-binaries
path: |
lexbor/install/include
lexbor/install/lib
build-linux-x64:
name: Build Linux X64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recurse'

- name: Build Lexbor
run: |
cd lexbor
mkdir build && mkdir install
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make
make install
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: linux-arm64-binaries
path: |
lexbor/install/include
lexbor/install/lib
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
lexbor/build/

### IntelliJ IDEA ###
.idea/
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ document.use { document ->
![](https://img.shields.io/static/v1?label=&message=macOS&color=blue)
![](https://img.shields.io/static/v1?label=&message=Windows&color=blue)
![](https://img.shields.io/static/v1?label=&message=iOS&color=blue)
![](https://img.shields.io/static/v1?label=&message=tvOS&color=blue)
![](https://img.shields.io/static/v1?label=&message=watchOS&color=blue)

```kotlin
repositories {
Expand Down
6 changes: 6 additions & 0 deletions cmake-files/ios-arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(CMAKE_SYSTEM_NAME iOS)
set(CMAKE_SYSTEM_PROCESSOR arm64)

set(CMAKE_OSX_ARCHITECTURES arm64)
set(CMAKE_OSX_DEPLOYMENT_TARGET 9.0)
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO)
6 changes: 6 additions & 0 deletions cmake-files/ios-x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(CMAKE_SYSTEM_NAME iOS)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_OSX_ARCHITECTURES x86_64)
set(CMAKE_OSX_DEPLOYMENT_TARGET 9.0)
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO)
16 changes: 16 additions & 0 deletions cmake-files/linux-arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm64)

# specify the cross compiler
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)

# where is the target environment
set(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
4 changes: 4 additions & 0 deletions cmake-files/macos-arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR arm64)

set(CMAKE_OSX_ARCHITECTURES arm64)
4 changes: 4 additions & 0 deletions cmake-files/macos-x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_OSX_ARCHITECTURES x86_64)

0 comments on commit 7ed8d1a

Please sign in to comment.