diff --git a/.github/workflows/halo.yml b/.github/workflows/halo.yml index 00fc4deb6..db70b57c2 100644 --- a/.github/workflows/halo.yml +++ b/.github/workflows/halo.yml @@ -47,8 +47,10 @@ jobs: cache: 'gradle' java-version: 11 - name: Build with Gradle - run: ./gradlew clean build -x test - + run: | + # Set the version with tag name when releasing + sed -i "s/version=.*-SNAPSHOT$/version=${{ github.event.release.tag_name }}/1" gradle.properties + ./gradlew clean build -x test - name: Archive halo jar uses: actions/upload-artifact@v2 with: diff --git a/build.gradle b/build.gradle index 6636832b8..8abc1a57e 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,6 @@ plugins { } group = "run.halo.app" -version = "1.4.13" description = "Halo, An excellent open source blog publishing application." sourceCompatibility = JavaVersion.VERSION_11 @@ -174,4 +173,4 @@ task projectVersion { doLast { println project.version } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..de6d0b1d6 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +version=1.4.13-SNAPSHOT