diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7438f3e2..7102cb0f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,7 +22,7 @@ jobs: - name: Upload to Docker uses: eskatos/gradle-command-action@v1 with: - arguments: jib -Platest=true + arguments: jib env: DOCKER_KEY: ${{ secrets.DOCKER_KEY }} diff --git a/build.gradle b/build.gradle index 09e90b5c..6249a6de 100644 --- a/build.gradle +++ b/build.gradle @@ -142,17 +142,22 @@ jib { from { } to { - // execute with -Platest=true - // $ gradle jib -Platest=true + // by default publish as: + // dshackle:shapshot, + // dshackle:t, + // dshackle: and + // dshackle: + // dshackle:latest only when publishing first version with zero patch (ex. 1.2.0) image = [ project.hasProperty('docker') ? project.property('docker') : 'emeraldpay', '/dshackle:', - (project.hasProperty('latest') && project.property('latest') == 'true') ? 'latest' : 'snapshot' + 'snapshot' ].join('') tags = [project.version].with (true) { - if (!project.hasProperty('latest') || project.property('latest') != 'true') { - add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now()) + if (project.version.toString().endsWith(".0")) { + add "latest" } + add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now()) add project.version.toString().replaceAll('(\\d+\\.\\d+).+', '$1') } auth {