-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup lexbor build and publish workflow
- Loading branch information
1 parent
2794c51
commit 80b6056
Showing
14 changed files
with
354 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
name: Build and Release Lexbor Binaries | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'lexbor-v*' | ||
|
||
jobs: | ||
build-macos-arm64: | ||
name: Build macos arm64 | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- 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 -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos_arm64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-macos-x64: | ||
name: Build macos x64 | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- 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 -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos_x64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-ios-arm64: | ||
name: Build iOS arm64 | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- 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 -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ios_arm64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-ios-x64: | ||
name: Build iOS x64 | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- 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 -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ios_x64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-linux-x64: | ||
name: Build Linux x64 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Build Lexbor | ||
run: | | ||
cd lexbor | ||
mkdir build && mkdir install | ||
cd build | ||
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: linux_x64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-linux-arm64: | ||
name: Build Linux arm64 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
|
||
- name: Build Lexbor | ||
run: | | ||
cd lexbor | ||
mkdir build && mkdir install | ||
cd build | ||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/linux-arm64.cmake -DCMAKE_INSTALL_PREFIX=../install -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: linux_arm64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
build-windows-x64: | ||
name: Build Windows x64 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- run: sudo apt-get install -y mingw-w64 | ||
|
||
- name: Build Lexbor | ||
run: | | ||
cd lexbor | ||
mkdir build && mkdir install | ||
cd build | ||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/windows-x64.cmake -DCMAKE_INSTALL_PREFIX=../install -DLEXBOR_BUILD_SHARED=OFF | ||
make | ||
make install | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: mingw_x64 | ||
path: lexbor/install/lib/liblexbor_static.a | ||
|
||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: [ build-windows-x64, build-linux-arm64, build-linux-x64, build-ios-x64, build-ios-arm64, build-macos-x64, build-macos-arm64 ] | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
- run: | | ||
zip -r mingw_x64.zip mingw_x64 | ||
zip -r linux_arm64.zip linux_arm64 | ||
zip -r linux_x64.zip linux_x64 | ||
zip -r ios_x64.zip ios_x64 | ||
zip -r ios_arm64.zip ios_arm64 | ||
zip -r macos_x64.zip macos_x64 | ||
zip -r macos_arm64.zip macos_arm64 | ||
- name: Upload Artifacts to Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
mingw_x64.zip | ||
linux_arm64.zip | ||
linux_x64.zip | ||
ios_x64.zip | ||
ios_arm64.zip | ||
macos_x64.zip | ||
macos_arm64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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) | ||
|
||
execute_process( | ||
COMMAND xcrun --sdk iphoneos --show-sdk-path | ||
OUTPUT_VARIABLE IOS_SDK_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_OSX_SYSROOT ${IOS_SDK_PATH}) | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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) | ||
|
||
execute_process( | ||
COMMAND xcrun --sdk iphonesimulator --show-sdk-path | ||
OUTPUT_VARIABLE IOS_SIMULATOR_SDK_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_OSX_SYSROOT ${IOS_SIMULATOR_SDK_PATH}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR arm64) | ||
|
||
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++) | ||
set(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
set(CMAKE_SYSTEM_NAME Darwin) | ||
set(CMAKE_SYSTEM_PROCESSOR arm64) | ||
|
||
set(CMAKE_OSX_ARCHITECTURES arm64) | ||
|
||
execute_process( | ||
COMMAND xcrun --sdk macosx --show-sdk-path | ||
OUTPUT_VARIABLE MACOS_SDK_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_OSX_SYSROOT ${MACOS_SDK_PATH}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
set(CMAKE_SYSTEM_NAME Darwin) | ||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
|
||
set(CMAKE_OSX_ARCHITECTURES x86_64) | ||
|
||
execute_process( | ||
COMMAND xcrun --sdk macosx --show-sdk-path | ||
OUTPUT_VARIABLE MACOS_SDK_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_OSX_SYSROOT ${MACOS_SDK_PATH}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
|
||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) | ||
set(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc) | ||
set(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
Oops, something went wrong.