Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 34 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,17 @@ jobs:
mvn -version
echo "<settings><servers><server><id>central</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=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Deploy native artifact
- name: Build 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 }}
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
uses: actions/upload-artifact@v4
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/*.zip
if-no-files-found: error
retention-days: 1
linux-x86_64:
runs-on: ubuntu-22.04
needs: prepare
Expand All @@ -113,10 +120,17 @@ jobs:
mvn -version
echo "<settings><servers><server><id>central</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=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Deploy native artifact
- name: Build 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 }}
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
uses: actions/upload-artifact@v4
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/*.zip
if-no-files-found: error
retention-days: 1
macosx-arm64:
runs-on: macos-14
needs: prepare
Expand All @@ -138,10 +152,18 @@ jobs:
mvn -version
echo "<settings><servers><server><id>central</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=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Deploy native artifact
- name: Build 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 }}
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
- name: Upload native artifact
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
uses: actions/upload-artifact@v4
with:
name: native-artifact-${{ github.job }}${{ matrix.ext }}
path: tensorflow-core/tensorflow-core-native/target/*.zip
if-no-files-found: error
retention-days: 1

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, macosx-arm64, linux-arm64]
Expand All @@ -154,6 +176,12 @@ jobs:
java-version: '11'
- name: Checkout repository
uses: actions/checkout@v6
- name: Download native artifacts
uses: actions/download-artifact@v8
with:
pattern: native-artifact-*
path: tensorflow-core/tensorflow-core-native/target
merge-multiple: true
- name: Build project
run: |
java -version
Expand Down
15 changes: 9 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,6 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<ignorePublishedComponents>true</ignorePublishedComponents>
</configuration>
</plugin>
</plugins>

Expand All @@ -628,6 +622,15 @@
<useModulePath>false</useModulePath>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
149 changes: 79 additions & 70 deletions tensorflow-core/tensorflow-core-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,51 +85,51 @@
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-native-artifacts</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteReleases>true</overWriteReleases>
<useBaseVersion>true</useBaseVersion>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-x86_64}-gpu</classifier>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.macosx-arm64}</classifier>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-arm64}</classifier>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-dependency-plugin</artifactId>-->
<!-- <version>3.6.1</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>copy-native-artifacts</id>-->
<!-- <phase>validate</phase>-->
<!-- <goals>-->
<!-- <goal>copy</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <outputDirectory>${project.build.directory}</outputDirectory>-->
<!-- <overWriteSnapshots>true</overWriteSnapshots>-->
<!-- <overWriteReleases>true</overWriteReleases>-->
<!-- <useBaseVersion>true</useBaseVersion>-->
<!-- <artifactItems>-->
<!-- <artifactItem>-->
<!-- <groupId>${project.groupId}</groupId>-->
<!-- <artifactId>${project.artifactId}</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- <classifier>${javacpp.platform.linux-x86_64}</classifier>-->
<!-- </artifactItem>-->
<!-- <artifactItem>-->
<!-- <groupId>${project.groupId}</groupId>-->
<!-- <artifactId>${project.artifactId}</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- <classifier>${javacpp.platform.linux-x86_64}-gpu</classifier>-->
<!-- </artifactItem>-->
<!-- <artifactItem>-->
<!-- <groupId>${project.groupId}</groupId>-->
<!-- <artifactId>${project.artifactId}</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- <classifier>${javacpp.platform.macosx-arm64}</classifier>-->
<!-- </artifactItem>-->
<!-- <artifactItem>-->
<!-- <groupId>${project.groupId}</groupId>-->
<!-- <artifactId>${project.artifactId}</artifactId>-->
<!-- <version>${project.version}</version>-->
<!-- <classifier>${javacpp.platform.linux-arm64}</classifier>-->
<!-- </artifactItem>-->
<!-- </artifactItems>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down Expand Up @@ -565,32 +565,41 @@
</executions>
</plugin>

<!-- <plugin>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <version>3.1.1</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- &lt;!&ndash;-->
<!-- Deploy only native artifact-->
<!-- This is used by the CI build to only deploy the native JAR artifact in the platform-specific runners.-->
<!-- Other artifacts will be deployed in a second pass, when activating the `deploying` profile-->
<!-- &ndash;&gt;-->
<!-- <id>native-only</id>-->
<!-- <goals>-->
<!-- <goal>deploy-file</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- &lt;!&ndash; 'url' property must be provided in command line &ndash;&gt;-->
<!-- <file>${project.build.directory}/${project.artifactId}-${project.version}-${native.classifier}.jar</file>-->
<!-- <repositoryId>central</repositoryId>-->
<!-- <groupId>${project.groupId}</groupId>-->
<!-- <artifactId>${project.artifactId}</artifactId>-->
<!-- <classifier>${native.classifier}</classifier>-->
<!-- <pomFile>pom.xml</pomFile>-->
<!-- <generatePom>false</generatePom>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<!--
Deploy only native artifact
This is used by the CI build to only deploy the native JAR artifact in the platform-specific runners.
Other artifacts will be deployed in a second pass, when activating the `deploying` profile
-->
<id>native-only</id>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<!-- 'url' property must be provided in command line -->
<file>${project.build.directory}/${project.artifactId}-${project.version}-${native.classifier}.jar</file>
<repositoryId>central</repositoryId>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<classifier>${native.classifier}</classifier>
<pomFile>pom.xml</pomFile>
<generatePom>false</generatePom>
</configuration>
</execution>
</executions>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<configuration>
<skipPublishing>true</skipPublishing>
<outputFilename>${project.artifactId}-${project.version}-${native.classifier}.zip</outputFilename>
</configuration>
</plugin>

<plugin>
Expand Down
Loading