now snapshot versions have more correct name (#195)
This commit is contained in:
4
.github/workflows/publish.yaml
vendored
4
.github/workflows/publish.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Upload to Docker
|
- name: Upload to Docker
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
arguments: jib -Pdocker=drpcorg -Pbuild_version=${{ github.ref_name }}
|
arguments: jib -Pdocker=drpcorg
|
||||||
env:
|
env:
|
||||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
- name: Build zip
|
- name: Build zip
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
arguments: distZip -Pbuild_version=${{ github.ref_name }}
|
arguments: distZip
|
||||||
- name: Upload Release
|
- name: Upload Release
|
||||||
id: upload-release-asset
|
id: upload-release-asset
|
||||||
uses: svenstaro/upload-release-action@v1-release
|
uses: svenstaro/upload-release-action@v1-release
|
||||||
|
|||||||
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@@ -20,6 +20,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
@@ -32,6 +33,7 @@ jobs:
|
|||||||
- name: Check
|
- name: Check
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
arguments: check
|
arguments: check
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|||||||
19
build.gradle
19
build.gradle
@@ -36,7 +36,7 @@ group = 'io.emeraldpay.dshackle'
|
|||||||
// Version schema:
|
// Version schema:
|
||||||
// x.x.x for production, following SemVer model
|
// x.x.x for production, following SemVer model
|
||||||
// x.x.x-SNAPSHOT for development
|
// x.x.x-SNAPSHOT for development
|
||||||
version = project.hasProperty('build_version') ? project.property('build_version') : "0.0.1-SNAPSHOT"
|
version = "0.0.1-SNAPSHOT"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
@@ -199,6 +199,7 @@ jar {
|
|||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
distZip.dependsOn(jar)
|
distZip.dependsOn(jar)
|
||||||
|
generateVersion.dependsOn(getVersion)
|
||||||
compileKotlin.dependsOn(generateVersion)
|
compileKotlin.dependsOn(generateVersion)
|
||||||
jar.dependsOn(generateVersion)
|
jar.dependsOn(generateVersion)
|
||||||
}
|
}
|
||||||
@@ -317,5 +318,17 @@ tasks.withType(Detekt).configureEach {
|
|||||||
jvmTarget = "17"
|
jvmTarget = "17"
|
||||||
}
|
}
|
||||||
|
|
||||||
// formats code for each build
|
task getVersion {
|
||||||
tasks.findByName("ktlintCheck").dependsOn("ktlintFormat")
|
def exactVersion = 'git describe --tags --exact-match'.execute().text.trim()
|
||||||
|
if (exactVersion) {
|
||||||
|
version = exactVersion
|
||||||
|
} else {
|
||||||
|
def tag = 'git describe --tags --abbrev=0'.execute().text.trim()
|
||||||
|
def m = tag =~ /\.(\d+)$/
|
||||||
|
def match = m[0][1]
|
||||||
|
def next = match.toInteger() + 1
|
||||||
|
tag = tag.replaceAll(/.\d+$/, "." + next.toString())
|
||||||
|
version = tag + '-SNAPSHOT'
|
||||||
|
}
|
||||||
|
version = version.replaceAll(/^v/, '')
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user