Skip to content

Commit

Permalink
Working on macOS ARM 64 build support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craigacp committed Feb 2, 2024
1 parent 4417c0e commit 190cfdb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@ jobs:
mvn -version
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.CI_DEPLOY_USERNAME }}</username><password>${{ secrets.CI_DEPLOY_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }}
macosx-arm64:
runs-on: macos-14
needs: prepare
strategy:
matrix:
ext: [""]
steps:
- name: Configure Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Checkout repository
uses: actions/checkout@v1
- name: Build project
run: |
clang --version
mvn -version
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.CI_DEPLOY_USERNAME }}</username><password>${{ secrets.CI_DEPLOY_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=macosx-arm64 -Djavacpp.platform.extension=${{ matrix.ext }} -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }}
macosx-x86_64:
runs-on: macos-11
needs: prepare
Expand Down Expand Up @@ -138,7 +158,7 @@ jobs:
if ERRORLEVEL 1 exit /b
deploy:
if: github.event_name == 'push' && contains(github.ref, 'master')
needs: [linux-x86_64, macosx-x86_64, windows-x86_64]
needs: [linux-x86_64, macosx-x86_64, windows-x86_64, macosx-arm64]
runs-on: ubuntu-20.04
steps:
- name: Configure Java
Expand Down
43 changes: 42 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,47 @@ jobs:
echo Executing Maven $MAVEN_PHASE
mvn clean $MAVEN_PHASE -B -U -e -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} -pl $NATIVE_BUILD_PROJECTS -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }} "-Dnative.build.flags=$BAZEL_CACHE"
df -h
macosx-arm64:
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI build')
runs-on: macos-14
needs: prepare
strategy:
matrix:
ext: [""]
steps:
- name: Install environment
run: |
python3 -m pip install numpy six
echo Downloading Bazel
curl -L https://github.com/bazelbuild/bazel/releases/download/5.1.1/bazel-5.1.1-installer-darwin-arm64.sh -o bazel.sh --retry 10
bash bazel.sh
brew install libomp perl
- name: Configure Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Checkout repository
uses: actions/checkout@v1
- name: Build project
run: |
git --version
clang --version
mvn -version
bazel version
mkdir -p $HOME/.m2
[[ "${{ github.event_name }}" == "push" ]] && MAVEN_PHASE=deploy || MAVEN_PHASE=install
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.CI_DEPLOY_USERNAME }}</username><password>${{ secrets.CI_DEPLOY_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "tensorflow/java" ]]; then
printf '%s\n' "${GCP_CREDS}" > $HOME/gcp_creds.json
export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=true --google_credentials=$HOME/gcp_creds.json"
else
export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=false"
fi
df -h
echo Executing Maven $MAVEN_PHASE
mvn clean $MAVEN_PHASE -B -U -e -Djavacpp.platform=macosx-arm64 -Djavacpp.platform.extension=${{ matrix.ext }} -pl $NATIVE_BUILD_PROJECTS -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }} "-Dnative.build.flags=$BAZEL_CACHE"
df -h
macosx-x86_64:
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI build')
runs-on: macos-10.15
Expand Down Expand Up @@ -286,7 +327,7 @@ jobs:
wmic pagefile list /format:list
deploy:
if: github.event_name == 'push' && contains(github.ref, 'master')
needs: [linux-x86_64, macosx-x86_64, windows-x86_64]
needs: [linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64]
runs-on: ubuntu-18.04
steps:
- name: Configure Java
Expand Down

0 comments on commit 190cfdb

Please sign in to comment.