[editor only] Include commit sha in snapshot version
This commit is contained in:
@@ -20,12 +20,17 @@ jobs:
|
||||
uses: joschi/setup-jdk@v2.3.0
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Compute vars
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build JAR dist files
|
||||
run: ./gradlew dist
|
||||
- name: Build deb package
|
||||
run: ./gradlew jpackage
|
||||
env:
|
||||
COMMIT_SHA: ${{ steps.vars.outputs.sha_short }}
|
||||
run: ./gradlew jpackage -PSNAPSHOT=true
|
||||
- name: Fix deb file names
|
||||
run: mv build/jpackage/*.deb HyperLap2D-SNAPSHOT.deb
|
||||
- name: Upload deb artifact
|
||||
@@ -52,10 +57,15 @@ jobs:
|
||||
uses: joschi/setup-jdk@v2.3.0
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Compute vars
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
- name: Build JAR dist files
|
||||
run: ./gradlew.bat dist
|
||||
- name: Build msi package
|
||||
run: ./gradlew.bat jpackage
|
||||
env:
|
||||
COMMIT_SHA: ${{ steps.vars.outputs.sha_short }}
|
||||
run: ./gradlew.bat jpackage -PSNAPSHOT=true
|
||||
- name: Fix file names
|
||||
run: mv build/jpackage/*.msi HyperLap2D-SNAPSHOT.msi
|
||||
- name: Upload msi artifact
|
||||
@@ -76,12 +86,17 @@ jobs:
|
||||
uses: joschi/setup-jdk@v2.3.0
|
||||
with:
|
||||
java-version: 14
|
||||
- name: Compute vars
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build JAR dist files
|
||||
run: ./gradlew dist
|
||||
- name: Build dmg package
|
||||
run: ./gradlew jpackage
|
||||
env:
|
||||
COMMIT_SHA: ${{ steps.vars.outputs.sha_short }}
|
||||
run: ./gradlew jpackage -PSNAPSHOT=true
|
||||
- name: Fix file names
|
||||
run: mv build/jpackage/*.dmg HyperLap2D-SNAPSHOT.dmg
|
||||
- name: Upload dmg artifact
|
||||
|
||||
+10
-2
@@ -116,6 +116,14 @@ dependencies {
|
||||
testImplementation group: 'junit', name: 'junit', version: '4.12'
|
||||
}
|
||||
|
||||
def getBuildVersion = {
|
||||
if (project.hasProperty('SNAPSHOT')) {
|
||||
return getVersion() + project.hasProperty('COMMIT_SHA') ? COMMIT_SHA : "$System.env.COMMIT_SHA"
|
||||
} else {
|
||||
return getVersion()
|
||||
}
|
||||
}
|
||||
|
||||
runtime {
|
||||
javaHome.set(System.getProperty("java.home"))
|
||||
options = ['--strip-debug',
|
||||
@@ -136,7 +144,7 @@ runtime {
|
||||
|
||||
jpackage {
|
||||
mainJar = dist.archiveFileName.get()
|
||||
imageOptions += ['--app-version', getVersion(), '--vendor', 'Red & Black Games', '--description', 'HyperLap2D Editor', '--name', 'HyperLap2D']
|
||||
imageOptions += ['--app-version', getBuildVersion(), '--vendor', 'Red & Black Games', '--description', 'HyperLap2D Editor', '--name', 'HyperLap2D']
|
||||
installerOptions += ['--license-file', 'LICENSE']
|
||||
if (osName.contains('windows')) {
|
||||
imageOptions += ["--icon", file("icons/icon.ico")]
|
||||
@@ -158,7 +166,7 @@ runtime {
|
||||
imageOptions += ['--copyright', '(c) 2020, Red & Black Games', "--icon", file("icons/icon.icns")
|
||||
, '--resource-dir', "${projectDir}/resources-macos"]
|
||||
jvmArgs = ['-XstartOnFirstThread', '-Djava.awt.headless=true']
|
||||
installerOptions += ['--verbose','--app-version', getVersion(), '--vendor', 'Red & Black Games', '--resource-dir', "${projectDir}/resources-macos" ]
|
||||
installerOptions += ['--verbose','--app-version', getBuildVersion(), '--vendor', 'Red & Black Games', '--resource-dir', "${projectDir}/resources-macos" ]
|
||||
installerType = 'dmg'
|
||||
resourceDir = file("resources-macos")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user