Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build wrappers for iOS, macOS, windows and UWP #2304

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cf71927
First attempt at building iOS wrappers
LaPeste Mar 22, 2021
d9aaff2
Added hash prefix as the macos and ios resulted with the same default…
LaPeste Mar 23, 2021
2446322
Test bulding windows wrappers
LaPeste Mar 23, 2021
c1278f7
Minor changes
LaPeste Mar 23, 2021
88dfccd
Test to see if some steps mess up with the win repo
LaPeste Mar 24, 2021
3ddd0ba
Updated build-ios.sh to fix relative path
LaPeste Mar 24, 2021
9b83bcf
Hopefully build windows
LaPeste Mar 24, 2021
4c80d48
Fixed win for powershell
LaPeste Mar 24, 2021
4de99b1
Merge branch 'ac/build-macos-wrappers-github-actions' into ac/ga-buil…
LaPeste Mar 30, 2021
e5443e1
Fixed input name in workflow
LaPeste Mar 30, 2021
1bbc8b4
Cache win dependences
LaPeste Mar 30, 2021
f419ade
Cache win dependences - path no more C
LaPeste Mar 30, 2021
f00a2c9
Cache win dependences - more fix
LaPeste Mar 30, 2021
e61dd5e
Matrix arch on win
LaPeste Mar 30, 2021
1e18823
Input parsing again to check skip path
LaPeste Mar 30, 2021
1318e3b
Confused by string interpretation
LaPeste Mar 30, 2021
2d1736d
Confused by string interpretation - again
LaPeste Mar 30, 2021
c541fb1
Reverte all, no cache for win deps
LaPeste Mar 30, 2021
69a4a36
Second attempt to cache win dependencies
LaPeste Mar 31, 2021
45e9994
Added build of UWP wrappers
LaPeste Mar 31, 2021
230df65
Attemp to reduce steps in win builds
LaPeste Mar 31, 2021
41b5a07
Attemp to reduce steps in win builds - 2
LaPeste Mar 31, 2021
96702c8
Attemp to reduce steps in win builds - some fixes
LaPeste Mar 31, 2021
69f26ec
Forgot to fetch dependencies from cache
LaPeste Apr 6, 2021
d591c35
Added cache on win wrappers
LaPeste Apr 6, 2021
f151335
Revert to smartly use the default cache action
LaPeste Apr 6, 2021
3cb43bd
Check time to build with smaller dependencies arch and removed cache …
LaPeste Apr 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build_cache_executor/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const actionCore = __importStar(__nccwpck_require__(9301));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const path = core.getInput("cachePath", { required: true });
const cmd = core.getInput("cmd", { required: true });
const path = core.getInput("cachePath", { required: true });
const cacheKey = yield actionCore.actionCore(path, cmd, core);
if (cacheKey === undefined) {
core.setFailed(`Action aborted because either artifacts could not be built or they could not be cached`);
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build_cache_executor/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as actionCore from "../../../ga_packages/build_cache_executor/dist/buil

async function run(): Promise<void> {
try {
const path = core.getInput("cachePath", { required: true });
const cmd = core.getInput("cmd", { required: true });
const path = core.getInput("cachePath", { required: true });

const cacheKey = await actionCore.actionCore(path, cmd, core);

Expand Down
9 changes: 9 additions & 0 deletions .github/actions/get-vcpkg-prebuilt/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'get-vcpkg-prebuilt'
description: 'Get windows build dependencies'
runs:
using: "composite"
steps:
- run: |
Invoke-WebRequest -Uri https://static.realm.io/downloads/vcpkg.zip -OutFile C:\vcpkg.zip
Expand-Archive -Path C:\vcpkg.zip -DestinationPath C:\
shell: powershell
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
10 changes: 10 additions & 0 deletions .github/ga_packages/build_cache_executor/dist/input_parsing.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 108 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,118 @@ name: build and test
on: [push]

jobs:
build-wrappers-macos:
runs-on: macos-latest
name: Build macOs wrappers
# build-wrappers-macos:
# runs-on: macos-latest
# name: Build macOs wrappers
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Build wrappers
# uses: ./.github/actions/build_cache_executor
# env:
# REALM_CMAKE_CONFIGURATION: Release
# with:
# cmd: ./wrappers/build-macos.sh
# cachePath: ./wrappers

# build-wrappers-ios:
# runs-on: macos-latest
# name: Build iOS wrappers
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Build wrappers
# uses: ./.github/actions/build_cache_executor
# with:
# cmd: ./wrappers/build-ios.sh --configuration=Release
# cachePath: ./wrappers

# fetch-windows-dependencies:
# runs-on: windows-latest
# name: Fetch windows dependencies
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Check if cached dependencies
# id: dependencies-cache
# uses: actions/cache@v2
# with:
# path: 'C:\src'
# key: dependencies-windows-${{hashfiles('.\wrappers\build.ps1')}}
# - name: Fetch dependencies
# if: steps.dependencies-cache.outputs.cache-hit != 'true'
# uses: .\.github\actions\get-vcpkg-prebuilt

build-wrappers-windows:
runs-on: windows-latest
name: Build Windows wrappers
# needs: fetch-windows-dependencies
strategy:
matrix:
arch: [Win32, x64]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
# - name: Check if contains wrappers already
# uses: actions/cache@v2
# id: wrapper-cache
# with:
# path: ./wrappers/build/
# key: wrapper-windows-${{ matrix.arch }}-${{hashfiles('./wrappers/**')}}
# - name: Obtain the cached dependencies
# if: steps.wrapper-cache.outputs.cache-hit != 'true'
# uses: actions/cache@v2
# with:
# path: 'C:\src'
# key: dependencies-windows-${{hashfiles('.\wrappers\build.ps1')}}
- name: Fetch dependencies
uses: .\.github\actions\get-vcpkg-prebuilt
- name: Build wrappers
uses: ./.github/actions/build_cache_executor
env:
REALM_CMAKE_CONFIGURATION: Release
# if: steps.wrapper-cache.outputs.cache-hit != 'true'
# uses: .\.github\actions\build_cache_executor
# with:
# cmd: powershell .\wrappers\build.ps1 Windows -Configuration Release -Platforms ${{ matrix.arch }}
# cachePath: .\wrappers
run: powershell .\wrappers\build.ps1 Windows -Configuration Release -Platforms ${{ matrix.arch }}

build-wrappers-windows-uwp:
runs-on: windows-latest
name: Build Windows UWP wrappers
# needs: fetch-windows-dependencies
strategy:
matrix:
arch: [Win32, x64, ARM]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
cmd: ./wrappers/build-macos.sh
cachePath: ./wrappers
submodules: recursive
# - name: Check if contains wrappers already
# uses: actions/cache@v2
# id: wrapper-cache
# with:
# path: ./wrappers/build/
# key: wrapper-windows-uwp-${{ matrix.arch }}-${{hashfiles('./wrappers/**')}}
# - name: Obtain the cached dependencies
# if: steps.wrapper-cache.outputs.cache-hit != 'true'
# uses: actions/cache@v2
# with:
# path: 'C:\src'
# key: dependencies-windows-${{hashfiles('.\wrappers\build.ps1')}}
- name: Fetch dependencies
uses: .\.github\actions\get-vcpkg-prebuilt
- name: Build wrappers
# if: steps.wrapper-cache.outputs.cache-hit != 'true'
# uses: .\.github\actions\build_cache_executor
# with:
# cmd: powershell .\wrappers\build.ps1 WindowsStore -Configuration Release -Platforms ${{ matrix.arch }}
# cachePath: .\wrappers
run: powershell .\wrappers\build.ps1 WindowsStore -Configuration Release -Platforms ${{ matrix.arch }}
8 changes: 4 additions & 4 deletions wrappers/build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ function build() {

# This is a workaround for CMAKE_IOS_INSTALL_COMBINED removing @rpath from LC_DYLIB_ID.
# Reported here: https://cmake.org/pipermail/cmake/2018-October/068316.html
rm build/iOS/$REALM_CMAKE_CONFIGURATION/realm-wrappers.framework/realm-wrappers
xcrun lipo -create cmake/iOS/src/$REALM_CMAKE_CONFIGURATION-iphoneos/realm-wrappers.framework/realm-wrappers \
cmake/iOS/src/$REALM_CMAKE_CONFIGURATION-iphonesimulator/realm-wrappers.framework/realm-wrappers \
-output build/iOS/$REALM_CMAKE_CONFIGURATION/realm-wrappers.framework/realm-wrappers
rm "$SCRIPT_DIRECTORY"/build/iOS/$REALM_CMAKE_CONFIGURATION/realm-wrappers.framework/realm-wrappers
xcrun lipo -create "$SCRIPT_DIRECTORY"/cmake/iOS/src/$REALM_CMAKE_CONFIGURATION-iphoneos/realm-wrappers.framework/realm-wrappers \
"$SCRIPT_DIRECTORY"/cmake/iOS/src/$REALM_CMAKE_CONFIGURATION-iphonesimulator/realm-wrappers.framework/realm-wrappers \
-output "$SCRIPT_DIRECTORY"/build/iOS/$REALM_CMAKE_CONFIGURATION/realm-wrappers.framework/realm-wrappers
}

build