package: use commit instead of SNAPSHOT versions

This commit is contained in:
Max Weber
2021-06-13 22:10:58 -06:00
parent cdfd5aaff1
commit 518ce3f265
2 changed files with 11 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ jobs:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: package-2.0.5
key: package-2.0.6
- name: prepare
run: |
pushd package
@@ -80,7 +80,7 @@ jobs:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: upload-2.0.5
key: upload-2.0.6
- uses: actions/download-artifact@v2
with:
name: manifest_diff

View File

@@ -450,11 +450,18 @@ public class Plugin implements Closeable
{
Properties chunk = loadProperties(new File(buildDirectory, "chunk.properties"));
manifest.setVersion(chunk.getProperty("version"));
if (Strings.isNullOrEmpty(manifest.getVersion()))
String version = chunk.getProperty("version");
if (Strings.isNullOrEmpty(version))
{
throw new IllegalStateException("version in empty");
}
if (version.endsWith("SNAPSHOT"))
{
version = commit.substring(0, 8);
}
manifest.setVersion(version);
}
{