-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
56 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 |
---|---|---|
|
@@ -82,13 +82,13 @@ jobs: | |
- name: Build JNI Stub | ||
working-directory: ./packages | ||
run: ./gradlew -i :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false | ||
run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ./packages/jni-swig-stub/build/generated/sources/**/* | ||
path: ./packages/jni-swig-stub/build/generated/sources/jni/* | ||
retention-days: 1 | ||
|
||
build-jvm-linux-native-lib: | ||
|
@@ -122,7 +122,7 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ./packages/jni-swig-stub/build/generated/sources | ||
path: ./packages/jni-swig-stub/build/generated/sources/jni | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v3 | ||
|
@@ -195,7 +195,7 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources | ||
path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni | ||
|
||
- name: Build native lib | ||
shell: powershell | ||
|
@@ -296,7 +296,7 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources | ||
path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni | ||
|
||
- name: Build packages | ||
working-directory: packages | ||
|
@@ -311,7 +311,7 @@ jobs: | |
|
||
build-kotlin-metadata-package: | ||
runs-on: ubuntu-latest | ||
needs: [check-cache, build-jni-swig-stub] | ||
needs: [check-cache] | ||
if: | | ||
always() && | ||
!cancelled() && | ||
|
@@ -375,15 +375,9 @@ jobs: | |
path: ./packages/build/m2-buildrepo | ||
key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} | ||
|
||
- name: Restore JNI Swig Stubs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ./packages/jni-swig-stub/build/generated/sources | ||
|
||
- name: Build Kotlin Metadata and Gradle and Compiler Plugin | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -438,13 +432,6 @@ jobs: | |
key: 'jvm-package' | ||
max-size: '2.0G' | ||
|
||
- name: Set up Homebrew | ||
id: set-up-homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
|
||
- name: Install tree command | ||
run: brew install tree | ||
|
||
- name: Prepend ccache executables to the PATH | ||
run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH | ||
|
||
|
@@ -469,18 +456,6 @@ jobs: | |
path: ./packages/build/m2-buildrepo | ||
key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} | ||
|
||
- name: Tree before restore | ||
run: tree ${{ github.workspace }}/packages/jni-swig-stub | ||
|
||
- name: Restore JNI Swig Stubs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources | ||
|
||
- name: Tree after restore | ||
run: tree ${{ github.workspace }}/packages/jni-swig-stub | ||
|
||
- name: Restore Linux JNI lib | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
@@ -501,7 +476,7 @@ jobs: | |
|
||
- name: Build JVM Package | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -510,22 +485,10 @@ jobs: | |
path: ./packages/build/m2-buildrepo/**/* | ||
retention-days: 1 | ||
|
||
- name: Tree after failure | ||
if: always() | ||
run: tree ${{ github.workspace }}/packages/jni-swig-stub | ||
|
||
- name: Upload swig dir | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: swig-dir-${{ needs.check-cache.outputs.version-label }} | ||
path: ./packages/jni-swig-stub/build/**/* | ||
retention-days: 1 | ||
|
||
|
||
build-android-packages: | ||
runs-on: ubuntu-latest | ||
needs: [check-cache, build-jni-swig-stub] | ||
needs: check-cache | ||
outputs: | ||
baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }} | ||
if: | | ||
|
@@ -556,6 +519,26 @@ jobs: | |
with: | ||
cache-read-only: false | ||
|
||
# Manually install SWIG 4.2. as only 4.0.2 is pre-installed | ||
# 4.2.0 is not available in apt-get, so use brew instead | ||
# We need to use the formulae directly from GitHub to pin the version as Homebrew does not have | ||
# all versions available. | ||
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts | ||
# It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. | ||
- name: Install SWIG | ||
run: | | ||
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" | ||
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile | ||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile | ||
echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH | ||
cd ~ | ||
curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb | ||
- name: Install JSON parser | ||
run: brew install jq | ||
|
||
- name: Setup cmake | ||
uses: jwlawson/[email protected] | ||
with: | ||
|
@@ -589,12 +572,6 @@ jobs: | |
with: | ||
ndk-version: r23c | ||
|
||
- name: Restore JNI Swig Stubs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: jni-stub-${{ needs.check-cache.outputs.version-label }} | ||
path: ./packages/jni-swig-stub/build/generated/sources | ||
|
||
- name: Build Android Base Test Apk | ||
working-directory: packages | ||
run: ./gradlew :test-base:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false | ||
|
@@ -605,7 +582,7 @@ jobs: | |
|
||
- name: Build packages | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false | ||
|
||
- name: Store build cache | ||
uses: actions/cache@v3 | ||
|
@@ -706,7 +683,7 @@ jobs: | |
- name: Build packages | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false | ||
|
||
# We cannot use artifacts as they cannot be shared between workflows, so use cache instead. | ||
- name: Store build cache | ||
|
@@ -775,7 +752,7 @@ jobs: | |
- name: Build packages | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false | ||
|
||
- name: Store build cache | ||
uses: actions/cache@v3 | ||
|
@@ -843,7 +820,7 @@ jobs: | |
- name: Build packages | ||
working-directory: packages | ||
run: ./gradlew -x :jni-swig-stub:realmWrapperJvm publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false | ||
run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false | ||
|
||
# We cannot use artifacts as they cannot be shared between workflows, so use cache instead. | ||
- name: Store build cache | ||
|