diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b3d9001..d1df18ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,11 +46,14 @@ jobs: java-version: ${{ env.JAVA_VERSION }} java-package: jdk architecture: x64 + + - name: Set build version information + run: | + echo ORG_GRADLE_PROJECT_CI_VERSION="${GITHUB_REF##*/v}" >> $GITHUB_ENV + echo ORG_GRADLE_PROJECT_CI_COMMIT_HASH="$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Build - run: > - ORG_GRADLE_PROJECT_CI_VERSION="${GITHUB_REF##*/}" - ORG_GRADLE_PROJECT_CI_COMMIT_HASH="$(git rev-parse HEAD)" - ./gradlew build -x test + run: ./gradlew build -x test - name: Create artifact run: > @@ -58,7 +61,7 @@ jobs: ARCHIVE_CMD="${{ matrix.archive_cmd }}" ARTIFACT_EXT="${{ matrix.artifact_ext }}" ENTRYPOINT_SCRIPT_EXT="${{ matrix.entrypoint_script_ext }}" - VERSION="${GITHUB_REF##*/}" + VERSION="${ORG_GRADLE_PROJECT_CI_VERSION}" ./script/create_artifact.sh - name: Release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65aa73ae..e2fee35b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,7 @@ jobs: build-artifact: runs-on: ${{ matrix.os }} env: - VERSION: ci + VERSION: 0.0.0-SNAPSHOT strategy: matrix: include: @@ -76,11 +76,14 @@ jobs: java-version: ${{ env.JAVA_VERSION }} java-package: jdk architecture: x64 + + - name: Set build version information + run: | + echo ORG_GRADLE_PROJECT_CI_VERSION="${VERSION}" >> $GITHUB_ENV + echo ORG_GRADLE_PROJECT_CI_COMMIT_HASH="$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Build - run: > - ORG_GRADLE_PROJECT_CI_VERSION="${VERSION}" - ORG_GRADLE_PROJECT_CI_COMMIT_HASH="$(git rev-parse HEAD)" - ./gradlew build -x test + run: ./gradlew build -x test - name: Create artifact run: > diff --git a/build.gradle b/build.gradle index 148bc14a..ed9a1f67 100644 --- a/build.gradle +++ b/build.gradle @@ -182,7 +182,7 @@ spotless { } } -version = 'dev' +version = '0.0.0-SNAPSHOT' if (project.hasProperty('CI_VERSION')) { version = CI_VERSION } @@ -243,7 +243,7 @@ tasks.register('runApp', Exec) { commandLine 'java', '--module-path', LIB_DIR, '--add-modules', APP_MODS.join(','), - '-jar', 'build/libs/tkfm-dev.jar' + '-jar', "build/libs/tkfm-${version}.jar" } if (project.hasProperty('CI_JMODS_DIR')) { diff --git a/script/build_for_linux.sh b/script/build_for_linux.sh index ecb261b6..28cd88ef 100755 --- a/script/build_for_linux.sh +++ b/script/build_for_linux.sh @@ -2,4 +2,4 @@ set -eux -APP_NAME="tkfm" JAVAFX_VERSION=16 OS_NAME=linux ARCHIVE_CMD="tar czf" ARTIFACT_EXT=.tar.gz ENTRYPOINT_SCRIPT_EXT="" VERSION="dev" ./script/create_artifact.sh +APP_NAME="tkfm" JAVAFX_VERSION=16 OS_NAME=linux ARCHIVE_CMD="tar czf" ARTIFACT_EXT=.tar.gz ENTRYPOINT_SCRIPT_EXT="" VERSION="0.0.0-SNAPSHOT" ./script/create_artifact.sh diff --git a/src/main/resources/com/jiro4989/tkfm/properties/application.properties b/src/main/resources/com/jiro4989/tkfm/properties/application.properties index a934edef..f6927f50 100644 --- a/src/main/resources/com/jiro4989/tkfm/properties/application.properties +++ b/src/main/resources/com/jiro4989/tkfm/properties/application.properties @@ -1,2 +1,2 @@ -version = dev +version = 0.0.0-SNAPSHOT commithash = dev \ No newline at end of file