Skip to content

Commit 492376a

Browse files
authored
Update build.yml
1 parent fd2f4c2 commit 492376a

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
if-no-files-found: error
129129
retention-days: 1
130130
deploy:
131-
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r')) }}
131+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
132132
needs: [linux-x86_64, macosx-arm64, linux-arm64]
133133
runs-on: ubuntu-22.04
134134
steps:
@@ -145,12 +145,39 @@ jobs:
145145
pattern: native-artifact-*
146146
path: tensorflow-core/tensorflow-core-native/target
147147
merge-multiple: true
148-
- name: Build project
148+
- name: Build and Deploy snapshot artifacts
149149
run: |
150150
java -version
151151
mvn -version
152-
mvn clean install -B -U -e -Pdeploying
153-
- name: Deploy snapshot artifacts
152+
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
153+
mvn deploy -Pdeploying -B -e
154+
release:
155+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }}
156+
needs: [linux-x86_64, macosx-arm64, linux-arm64]
157+
runs-on: ubuntu-22.04
158+
steps:
159+
- name: Configure Java
160+
uses: actions/setup-java@v5
161+
with:
162+
distribution: 'adopt'
163+
java-version: '11'
164+
server-id: central
165+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
166+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # Handled as an env variable name reference
167+
- name: Checkout repository
168+
uses: actions/checkout@v6
169+
- name: Download native artifacts
170+
uses: actions/download-artifact@v8
171+
with:
172+
pattern: native-artifact-*
173+
path: tensorflow-core/tensorflow-core-native/target
174+
merge-multiple: true
175+
- name: Build and Deploy release artifacts
176+
env:
177+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
154178
run: |
179+
java -version
180+
mvn -version
155181
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
156-
mvn deploy -Pdeploying -B -e -Dmaven.test.skip=true
182+
mvn clean deploy -Pdeploying -Preleasing -B -e
183+

0 commit comments

Comments
 (0)