Skip to content

Commit 3e14cd3

Browse files
authored
Rollback to deployment management (#640)
1 parent 6c63e42 commit 3e14cd3

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
echo "::set-output name=stagingRepositoryId::$STAGING_REPOSITORY_ID"
5555
- name: Checkout repository
5656
uses: actions/checkout@v6
57+
- name: Extract distribution repository URL
58+
id: repository
59+
run: |
60+
if [[ "${{ env.DEPLOY_RELEASE }}" = "true" ]]; then
61+
export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.repository.url}" -DstagingRepositoryId=${{ steps.staging.outputs.stagingRepositoryId }}`
62+
else
63+
export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.snapshotRepository.url}"`
64+
fi
65+
echo "Repository URL: $REPOSITORY_URL"
66+
echo "::set-output name=repositoryUrl::$REPOSITORY_URL"
5767
linux-arm64:
5868
runs-on: ubuntu-2204-arm64-2c
5969
needs: prepare
@@ -81,7 +91,7 @@ jobs:
8191
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
8292
- name: Deploy native artifact
8393
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
84-
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 }}
94+
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 }}
8595
linux-x86_64:
8696
runs-on: ubuntu-22.04
8797
needs: prepare
@@ -104,7 +114,7 @@ jobs:
104114
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
105115
- name: Deploy native artifact
106116
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
107-
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 }}
117+
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 }}
108118
macosx-arm64:
109119
runs-on: macos-14
110120
needs: prepare

pom.xml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@
8181
</pluginRepository>
8282
</pluginRepositories>
8383

84+
<!--
85+
Deploys to OSSRH/Maven central
86+
We don't need to deploy to Bintray, as JCenter will eventually proxy artifacts upload in Maven
87+
central. See Sonatype requirements at http://central.sonatype.org/pages/apache-maven.html
88+
-->
89+
<distributionManagement>
90+
<snapshotRepository>
91+
<id>central</id>
92+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
93+
</snapshotRepository>
94+
<repository>
95+
<id>ossrh</id>
96+
<url>
97+
https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/
98+
</url>
99+
</repository>
100+
</distributionManagement>
101+
84102
<dependencyManagement>
85103
<dependencies>
86104
<dependency>
@@ -494,16 +512,6 @@
494512
</execution>
495513
</executions>
496514
</plugin>
497-
<!-- Deploy to Maven central -->
498-
<plugin>
499-
<groupId>org.sonatype.central</groupId>
500-
<artifactId>central-publishing-maven-plugin</artifactId>
501-
<version>0.9.0</version>
502-
<extensions>true</extensions>
503-
<configuration>
504-
<publishingServerId>central</publishingServerId>
505-
</configuration>
506-
</plugin>
507515
<!-- GPG signed components: http://central.sonatype.org/pages/apache-maven.html#gpg-signed-components -->
508516
<plugin>
509517
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)