From 7e4232fcaac459fe1327b83a40d95654802768a7 Mon Sep 17 00:00:00 2001 From: CodeBreakerOO7 <106911174+CodeBreakerOO7@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:07:22 +0000 Subject: [PATCH 1/4] Update build.yml Included macOs 12 and Intel support --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c48921c272d..cc32cca256a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,8 +113,32 @@ jobs: - name: Deploy native artifact if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + macosx-x86_64: + runs-on: macos-12 + needs: prepare + strategy: + matrix: + ext: [""] + steps: + - name: Configure Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build project + run: | + clang --version + mvn -version + echo "ossrh${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + macosx-arm64: - runs-on: macos-14 + runs-on: macos-12 needs: prepare strategy: matrix: @@ -185,7 +209,7 @@ jobs: if ERRORLEVEL 1 exit /b deploy: if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} # DEPLOY_SNAPSHOT (releases should be signed and deployed manually from local machine) - needs: [linux-x86_64, windows-x86_64, macosx-arm64, linux-arm64] + needs: [linux-x86_64, windows-x86_64, macosx-x86_64 macosx-arm64, linux-arm64] runs-on: ubuntu-22.04 steps: - name: Configure Java From d79e7773597574a8650abf4a1e0521c3d19ae757 Mon Sep 17 00:00:00 2001 From: CodeBreakerOO7 <106911174+CodeBreakerOO7@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:21:07 +0000 Subject: [PATCH 2/4] Update build.yml Manual workflow start: workflow_dispatch: --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc32cca256a..47183255746 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ name: CI build on: + workflow_dispatch: push: branches: - master @@ -10,6 +11,7 @@ on: - master - r[0-9]+.* types: [opened, reopened, synchronize, labeled, unlabeled] + env: STAGING_PROFILE_ID: 46f80d0729c92d DEPLOY_SNAPSHOT: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} From b785dc5645a14b8b512dec78354048c0808b8f5e Mon Sep 17 00:00:00 2001 From: CodeBreakerOO7 <106911174+CodeBreakerOO7@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:23:27 +0000 Subject: [PATCH 3/4] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47183255746..21c6f1ce506 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -211,7 +211,7 @@ jobs: if ERRORLEVEL 1 exit /b deploy: if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} # DEPLOY_SNAPSHOT (releases should be signed and deployed manually from local machine) - needs: [linux-x86_64, windows-x86_64, macosx-x86_64 macosx-arm64, linux-arm64] + needs: [linux-x86_64, windows-x86_64, macosx-x86_64, macosx-arm64, linux-arm64] runs-on: ubuntu-22.04 steps: - name: Configure Java From 2bb1ff79df3a7ad4ed920eca864108730320b86e Mon Sep 17 00:00:00 2001 From: CodeBreakerOO7 <106911174+CodeBreakerOO7@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:58:45 +0000 Subject: [PATCH 4/4] Create build_github.yaml Builds Linux/macOS Tensorflow for Java --- .github/workflows/build_github.yaml | 100 ++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/build_github.yaml diff --git a/.github/workflows/build_github.yaml b/.github/workflows/build_github.yaml new file mode 100644 index 00000000000..2dc2653b1e4 --- /dev/null +++ b/.github/workflows/build_github.yaml @@ -0,0 +1,100 @@ +name: CI build + +on: + workflow_dispatch: + push: + branches: + - master + - staging + - r[0-9]+.* + pull_request: + branches: + - master + - r[0-9]+.* + types: [opened, reopened, synchronize, labeled, unlabeled] + +env: + DEPLOY_SNAPSHOT: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} + DEPLOY_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }} + +jobs: + check-format: + if: github.event_name == 'pull_request' + runs-on: ubuntu-22.04 + steps: + - name: Configure Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build project + run: | + gcc --version + mvn -version + mvn clean install -Pjdk17 -B -U -e -Dlint.skip=true -Dmaven.test.skip=true + - name: Run format checks + run: | + mvn spotless:check -Pjdk17 -B -U -e + + build: + runs-on: ubuntu-22.04 + needs: check-format + strategy: + matrix: + os: [ubuntu-22.04, macos-12] + java-version: [11, 17] + steps: + - name: Configure Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build project + run: | + gcc --version || true + clang --version || true + mvn -version + mvn clean install -B -U -e -Djavacpp.platform=${{ matrix.os }} -Djavacpp.platform.extension="" + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts-${{ matrix.os }}-java${{ matrix.java-version }} + path: | + target/*.jar + target/*.zip + + release: + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build-artifacts-ubuntu-22.04-java11 + path: build_artifacts + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + body: | + Automated release from CI workflow running on ${{ github.ref_name }}. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Assets + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build_artifacts/*.jar + asset_name: tensorflow-java-${{ github.ref_name }}.jar + asset_content_type: application/java-archive + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}