Skip to content

Commit b6b3e49

Browse files
committed
fix: add condition for deploy
Signed-off-by: zongz <[email protected]>
1 parent 8d5d659 commit b6b3e49

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/java-test.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ jobs:
142142
permissions:
143143
contents: read
144144
packages: write
145+
if: "startsWith(github.ref, 'refs/tags/')"
145146
needs: [ add-centos7-jni ]
146147
steps:
147148
- name: Checkout
@@ -162,6 +163,20 @@ jobs:
162163
path: java/target/
163164

164165
- name: Deploy to Github Packages
166+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
167+
working-directory: java
168+
run: |
169+
mvn package deploy \
170+
-DskipTests=true \
171+
-DskipCompile=true \
172+
-Dcargo-build.profile=release \
173+
-DserverId=github \
174+
-s $GITHUB_WORKSPACE/settings.xml
175+
env:
176+
GITHUB_TOKEN: ${{ github.token }}
177+
178+
- name: Release to Github Packages
179+
if: "startsWith(github.ref, 'refs/tags/')"
165180
working-directory: java
166181
run: |
167182
mvn package deploy \

0 commit comments

Comments
 (0)