Skip to content

Commit f97b912

Browse files
committed
update cicd
1 parent 281d66c commit f97b912

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Java CI-CD with Gradle
33
on:
44
push:
55
tags:
6-
- '*'
6+
- 'v*'
77

88
permissions:
99
contents: read
@@ -31,16 +31,22 @@ jobs:
3131
- name: "Stage"
3232
run: |
3333
mkdir -p staging
34-
mv build/libs/*.jar staging/
35-
- name: "Build & test"
34+
if ls build/libs/*.jar 1> /dev/null 2>&1; then
35+
mv build/libs/*.jar staging/
36+
else
37+
echo "No JAR files found"
38+
exit 1
39+
fi
40+
- name: "Extract Tag"
41+
id: tag
3642
run: |
3743
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
38-
echo "Tag: $TAG"
44+
echo "TAG=$TAG" >> $GITHUB_ENV
3945
- name: "GitHub Release"
4046
uses: "marvinpinto/action-automatic-releases@latest"
4147
with:
4248
repo_token: "${{ secrets.GITHUB_TOKEN }}"
43-
automatic_release_tag: "${{ steps.build.outputs.TAG }}"
49+
automatic_release_tag: "${{ env.TAG }}"
4450
prerelease: false
4551
files: |
4652
staging/*.jar

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "cn.lunadeer"
7-
version = "3.4"
7+
version = "3.5"
88

99
repositories {
1010
mavenCentral()

0 commit comments

Comments
 (0)