Skip to content

Commit

Permalink
chore: アプリケーションのバージョン書式を変更 (#82)
Browse files Browse the repository at this point in the history
* versionの書式を修正

* versionの書式を修正

* CIのversion書式を修正

* ファイル名のバージョン番号を修正

* versionの書式を修正
  • Loading branch information
jiro4989 authored Dec 29, 2021
1 parent c6202c5 commit 6026e70
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@ 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: >
OS_NAME="${{ matrix.os_name }}"
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
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
build-artifact:
runs-on: ${{ matrix.os }}
env:
VERSION: ci
VERSION: 0.0.0-SNAPSHOT
strategy:
matrix:
include:
Expand Down Expand Up @@ -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: >
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ spotless {
}
}

version = 'dev'
version = '0.0.0-SNAPSHOT'
if (project.hasProperty('CI_VERSION')) {
version = CI_VERSION
}
Expand Down Expand Up @@ -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')) {
Expand Down
2 changes: 1 addition & 1 deletion script/build_for_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = dev
version = 0.0.0-SNAPSHOT
commithash = dev

0 comments on commit 6026e70

Please sign in to comment.