Skip to content

Commit

Permalink
build android artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
justusranvier committed Sep 10, 2024
1 parent 9f93178 commit 4571531
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 60 deletions.
114 changes: 60 additions & 54 deletions .github/workflows/vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,55 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [macos-14-intel, macos-14-arm, windows-2022]
platform: [macos-arm64, macos-x64, windows-x64, android-arm64, android-x64]
include:
- platform: macos-14-intel
- platform: macos-arm64
runner: 'macos-14-large'
triplet: 'x64-osx-14'
- platform: macos-14-arm
- platform: macos-x64
runner: 'macos-14-xlarge'
triplet: 'arm64-osx-14'
- platform: windows-2022
- platform: windows-x64
runner: 'windows-2022-xl8'
triplet: 'x64-windows'
env:
VCPKG_INSTALLED_DIR: '${{ github.workspace }}/vcpkg_installed/${{ matrix.platform }}'
VCPKG_DEFAULT_TRIPLET: '${{ matrix.triplet }}'
VCPKG_DEFAULT_HOST_TRIPLET: '${{ matrix.triplet }}'
VCPKG_OVERLAY_TRIPLETS: '${{ github.workspace }}/overlay/triplets'
- platform: android-arm64
runner: 'ubuntu-latest'
- platform: android-x64
runner: 'ubuntu-latest'
steps:
- name: Get more disk space
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo rm -rvf /usr/lib/mono
sudo rm -rvf /usr/local/lib/android
sudo rm -rvf /usr/local/share/vcpkg
sudo rm -rvf /usr/share/miniconda
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo rm -rvf "/Applications/Xcode_14.3.1.app"
sudo rm -rvf "/Library/Frameworks/Mono.framework"
sudo rm -rvf "/Users/runner/Library/Android"
sudo rm -rvf "/usr/bin/link"
sudo rm -rvf "/usr/bin/link"
sudo rm -rvf "/usr/local/miniconda"
sudo rm -rvf "/usr/local/opt/geckodriver/bin"
sudo rm -rvf "/usr/local/share/chromedriver-mac-x64"
sudo rm -rvf "/usr/local/share/edge_driver"
sudo rm -rvf "/usr/local/share/vcpkg"
sudo rm -rvf '${GOROOT_1_20_X64}'
sudo rm -rvf '${GOROOT_1_21_X64}'
sudo rm -rvf '${GOROOT_1_22_X64}'
sudo rm -rvf '${JAVA_HOME_8_X64}'
sudo rm -rvf '${JAVA_HOME_11_X64}'
sudo rm -rvf '${JAVA_HOME_17_X64}'
sudo rm -rvf '${JAVA_HOME_21_X64}'
elif [ "$RUNNER_OS" == "Windows" ]; then
rm -rvf "C:\Android"
rm -rvf "C:\Miniconda"
rm -rvf "C:\Program Files\dotnet"
rm -rvf "C:\SeleniumWebDrivers\"
rm -rvf "C:\selenium\"
rm -rvf "C:\tools\Apache24"
rm -rvf "C:\tools\nginx-1.27.0"
rm -rvf "C:\vcpkg"
rm -rvf '${JAVA_HOME_8_X64}'
rm -rvf '${JAVA_HOME_11_X64}'
rm -rvf '${JAVA_HOME_17_X64}'
rm -rvf '${JAVA_HOME_21_X64}'
fi
if [ "$RUNNER_OS" == "Linux" ]; then
sudo rm -rvf /usr/lib/mono
sudo rm -rvf /usr/local/share/vcpkg
sudo rm -rvf /usr/share/miniconda
elif [ "$RUNNER_OS" == "macOS" ]; then
sudo rm -rvf "/Applications/Xcode_14.*.app"
sudo rm -rvf "/Library/Frameworks/Mono.framework"
sudo rm -rvf "/usr/bin/link"
sudo rm -rvf "/usr/bin/link"
sudo rm -rvf "/usr/local/miniconda"
sudo rm -rvf "/usr/local/opt/geckodriver"
sudo rm -rvf "/usr/local/share/chromedriver-mac-x64"
sudo rm -rvf "/usr/local/share/edge_driver"
sudo rm -rvf "/usr/local/share/vcpkg"
sudo rm -rvf '${GOROOT_1_20_X64}'
sudo rm -rvf '${GOROOT_1_21_X64}'
sudo rm -rvf '${GOROOT_1_22_X64}'
sudo rm -rvf '${JAVA_HOME_8_X64}'
sudo rm -rvf '${JAVA_HOME_11_X64}'
sudo rm -rvf '${JAVA_HOME_17_X64}'
sudo rm -rvf '${JAVA_HOME_21_X64}'
elif [ "$RUNNER_OS" == "Windows" ]; then
rm -rvf "C:\Miniconda"
rm -rvf "C:\Program Files\dotnet"
rm -rvf "C:\SeleniumWebDrivers\"
rm -rvf "C:\selenium\"
rm -rvf "C:\tools\Apache24"
rm -rvf "C:\tools\nginx-1.27.0"
rm -rvf "C:\vcpkg"
rm -rvf '${JAVA_HOME_8_X64}'
rm -rvf '${JAVA_HOME_11_X64}'
rm -rvf '${JAVA_HOME_17_X64}'
rm -rvf '${JAVA_HOME_21_X64}'
fi
shell: bash
continue-on-error: true
- name: Setup XCode
Expand All @@ -76,6 +69,20 @@ jobs:
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew install autoconf-archive automake libtool md4c
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update &&
DEBIAN_FRONTEND=noninteractive sudo apt-get install -qq \
autoconf \
autoconf-archive \
automake \
libegl1-mesa-dev \
libglu1-mesa-dev \
libx11-xcb-dev \
'^libxcb.*-dev' \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev
fi
shell: bash
- name: Checkout source
Expand All @@ -88,16 +95,15 @@ jobs:
- name: Run vcpkg
if: runner.os != 'Windows'
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'
runVcpkgInstall: true
- name: Run vcpkg
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: 'c:\vcpkg'
vcpkgJsonGlob: 'vcpkg.json'
runVcpkgInstall: true
- name: Build packages
uses: lukka/run-cmake@v10
with:
workflowPreset: '${{ matrix.platform }}'
- name: Compress packages
run: |
tar -czpf '${{ github.workspace }}/${{ matrix.platform }}.tar.gz' -C '${{ github.workspace }}/vcpkg_installed' '${{ matrix.platform }}'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
vcpkg_installed/
.clang-format

3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.26.0)
project(libopentxs-dependency-builder)
add_executable(stub main.cpp)
163 changes: 163 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"hidden": true,
"toolchainFile":
"$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"environment": {
"VCPKG_KEEP_ENV_VARS": "ANDROID_SDK_ROOT",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/overlay/triplets"
},
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"VCPKG_INSTALL_OPTIONS": "--allow-unsupported",
"VCPKG_INSTALLED_DIR":
"${sourceDir}/vcpkg_installed/${presetName}"
}
},
{
"name": "macos-arm64",
"inherits": [
"default"
],
"cacheVariables": {
"VCPKG_HOST_TRIPLET": "arm64-osx-14",
"VCPKG_TARGET_TRIPLET": "arm64-osx-14"
}
},
{
"name": "macos-x64",
"inherits": [
"default"
],
"cacheVariables": {
"VCPKG_HOST_TRIPLET": "x64-osx-14",
"VCPKG_TARGET_TRIPLET": "x64-osx-14"
}
},
{
"name": "windows-x64",
"inherits": [
"default"
],
"cacheVariables": {
"VCPKG_HOST_TRIPLET": "x64-windows",
"VCPKG_TARGET_TRIPLET": "x64-windows"
}
},
{
"name": "android-x64",
"inherits": [
"default"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-android"
}
},
{
"name": "android-arm64",
"inherits": [
"default"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-android"
}
}
],
"buildPresets": [
{
"name": "macos-arm64",
"configurePreset": "macos-arm64"
},
{
"name": "macos-x64",
"configurePreset": "macos-x64"
},
{
"name": "windows-x64",
"configurePreset": "windows-x64"
},
{
"name": "android-arm64",
"configurePreset": "android-arm64"
},
{
"name": "android-x64",
"configurePreset": "android-x64"
}
],
"workflowPresets": [
{
"name": "macos-arm64",
"steps": [
{
"type": "configure",
"name": "macos-arm64"
},
{
"type": "build",
"name": "macos-arm64"
}
]
},
{
"name": "macos-x64",
"steps": [
{
"type": "configure",
"name": "macos-x64"
},
{
"type": "build",
"name": "macos-x64"
}
]
},
{
"name": "windows-x64",
"steps": [
{
"type": "configure",
"name": "windows-x64"
},
{
"type": "build",
"name": "windows-x64"
}
]
},
{
"name": "android-arm64",
"steps": [
{
"type": "configure",
"name": "android-arm64"
},
{
"type": "build",
"name": "android-arm64"
}
]
},
{
"name": "android-x64",
"steps": [
{
"type": "configure",
"name": "android-x64"
},
{
"type": "build",
"name": "android-x64"
}
]
}
]
}
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int main() { return 0; }
19 changes: 14 additions & 5 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"$schema":
"https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "opentxs-dependency-builder",
"builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da",
"version": "1",
"$schema":
"https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "libopentxs-dependency-builder",
"version": "1",
"dependencies": [
"boost-algorithm",
{
Expand Down Expand Up @@ -64,6 +63,16 @@
"widgets"
]
},
{
"name": "qtbase",
"platform": "android",
"default-features": false,
"features": [
"egl",
"gles2",
"opengl"
]
},
"qtdeclarative",
"secp256k1",
"simpleini",
Expand Down

0 comments on commit 4571531

Please sign in to comment.