Skip to content

Commit a376dca

Browse files
authored
Set the final version with tag name when releasing (halo-dev#1511)
Signed-off-by: John Niang <[email protected]>
1 parent 4ffbd50 commit a376dca

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/halo.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ jobs:
4747
cache: 'gradle'
4848
java-version: 11
4949
- name: Build with Gradle
50-
run: ./gradlew clean build -x test
51-
50+
run: |
51+
# Set the version with tag name when releasing
52+
sed -i "s/version=.*-SNAPSHOT$/version=${{ github.event.release.tag_name }}/1" gradle.properties
53+
./gradlew clean build -x test
5254
- name: Archive halo jar
5355
uses: actions/upload-artifact@v2
5456
with:

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ plugins {
66
}
77

88
group = "run.halo.app"
9-
version = "1.4.13"
109
description = "Halo, An excellent open source blog publishing application."
1110
sourceCompatibility = JavaVersion.VERSION_11
1211

@@ -174,4 +173,4 @@ task projectVersion {
174173
doLast {
175174
println project.version
176175
}
177-
}
176+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=1.4.13-SNAPSHOT

0 commit comments

Comments
 (0)