1111 - r[0-9]+.*
1212 types : [opened, reopened, synchronize, labeled, unlabeled]
1313env :
14- # STAGING_PROFILE_ID: 46f80d0729c92d
15- # DEPLOY_SNAPSHOT: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }}
16- # DEPLOY_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }}
17- DEPLOY : ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r')) }}
14+ DEPLOY : ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r')) }}
1815jobs :
1916 check-format :
2017 if : github.event_name == 'pull_request'
3734 - name : Run format checks
3835 run : |
3936 mvn spotless:check -Pjdk17 -B -U -e
40- # prepare:
41- # runs-on: ubuntu-22.04
42- # outputs:
43- # repositoryUrl: ${{ steps.repository.outputs.repositoryUrl }}
44- # steps:
45- # - name: Create staging repository
46- # if: env.DEPLOY_RELEASE == 'true'
47- # id: staging
48- # run: |
49- # echo "Creating staging repository with profile $STAGING_PROFILE_ID"
50- # echo "<promoteRequest><data><description>Releasing TF Java - created by CI build</description></data></promoteRequest>" > request.xml
51- # curl -X POST -d @request.xml -s -o response.xml -u ${{ secrets.CI_DEPLOY_USERNAME }}:${{ secrets.CI_DEPLOY_PASSWORD }} -H "Content-Type:application/xml" \
52- # https://ossrh-staging-api.central.sonatype.com/service/local/staging/profiles/$STAGING_PROFILE_ID/start
53- # export STAGING_REPOSITORY_ID=`awk -F'[<>]' '/stagedRepositoryId/{print $3}' response.xml`
54- # echo "Staging repository created: $STAGING_REPOSITORY_ID"
55- # echo "::set-output name=stagingRepositoryId::$STAGING_REPOSITORY_ID"
56- # - name: Checkout repository
57- # uses: actions/checkout@v6
58- # - name: Extract distribution repository URL
59- # id: repository
60- # run: |
61- # if [[ "${{ env.DEPLOY_RELEASE }}" = "true" ]]; then
62- # export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.repository.url}" -DstagingRepositoryId=${{ steps.staging.outputs.stagingRepositoryId }}`
63- # else
64- # export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.snapshotRepository.url}"`
65- # fi
66- # echo "Repository URL: $REPOSITORY_URL"
67- # echo "::set-output name=repositoryUrl::$REPOSITORY_URL"
6837 linux-arm64 :
6938 runs-on : ubuntu-2204-arm64-2c
70- # needs: prepare
7139 strategy :
7240 matrix :
7341 ext : [""]
9159 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
9260 mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
9361 - name : Build native artifact
94- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
9562 run : mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
9663 - name : Upload native artifact
97- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
9864 if : env.DEPLOY == 'true'
9965 uses : actions/upload-artifact@v4
10066 with :
10470 retention-days : 1
10571 linux-x86_64 :
10672 runs-on : ubuntu-22.04
107- # needs: prepare
10873 strategy :
10974 matrix :
11075 ext : ["", -gpu]
@@ -123,10 +88,8 @@ jobs:
12388 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
12489 mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
12590 - name : Build native artifact
126- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
12791 run : mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
12892 - name : Upload native artifact
129- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
13093 if : env.DEPLOY == 'true'
13194 uses : actions/upload-artifact@v4
13295 with :
13699 retention-days : 1
137100 macosx-arm64 :
138101 runs-on : macos-14
139- # needs: prepare
140102 strategy :
141103 matrix :
142104 ext : [""]
@@ -156,21 +118,17 @@ jobs:
156118 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
157119 mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
158120 - name : Build native artifact
159- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
160121 run : mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
161122 - name : Upload native artifact
162- # if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
163123 if : env.DEPLOY == 'true'
164124 uses : actions/upload-artifact@v4
165125 with :
166126 name : native-artifact-${{ github.job }}${{ matrix.ext }}
167127 path : tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar
168128 if-no-files-found : error
169129 retention-days : 1
170-
171130 deploy :
172- # 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)
173- if : env.DEPLOY == 'true'
131+ if : ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r')) }}
174132 needs : [linux-x86_64, macosx-arm64, linux-arm64]
175133 runs-on : ubuntu-22.04
176134 steps :
0 commit comments