From 749365ab844f7a0ef8d614278148b077ff6f2415 Mon Sep 17 00:00:00 2001 From: Peter vR Date: Wed, 23 Feb 2022 13:26:20 -0700 Subject: [PATCH] rev semver plugin version and update GHA (#20) --- .github/workflows/ci-build.yaml | 15 +-------------- .github/workflows/release.yaml | 15 ++++----------- .../src/main/kotlin/build-conventions.gradle.kts | 11 +++-------- gradle/libs.versions.toml | 2 +- 4 files changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 7ed187c..1bac7cc 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -29,26 +29,13 @@ jobs: fetch-depth: 0 - name: Build Develop - if: ${{ github.ref_name == 'develop' }} uses: gradle/gradle-build-action@v2 with: build-root-directory: ${{ inputs.source }} cache-read-only: ${{ github.ref != 'refs/heads/develop' }} # only update the cache on the default branch https://github.com/gradle/gradle-build-action#optimizing-cache-effectiveness arguments: | - -Psemver.develop.stage=beta - clean build - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Build Feature - if: ${{ github.ref_name != 'develop' && github.ref_name != 'main' }} - uses: gradle/gradle-build-action@v2 - with: - build-root-directory: ${{ inputs.source }} - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} # only update the cache on the default branch https://github.com/gradle/gradle-build-action#optimizing-cache-effectiveness - arguments: | - -Psemver.develop.stage=alpha clean build + --stacktrace env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 09c16a8..6f6a118 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,16 +4,8 @@ on: workflow_dispatch: if: github.ref == 'refs/heads/main' inputs: - stage: - description: 'Stage' - required: true - default: 'final' - type: choice - options: - - 'rc' - - 'final' - scope: - description: 'Scope' + modifier: + description: 'Version Modifier' required: true default: 'patch' type: choice @@ -45,10 +37,11 @@ jobs: build-root-directory: ${{ inputs.source }} cache-read-only: ${{ github.ref != 'refs/heads/develop' }} # only update the cache on the default branch https://github.com/gradle/gradle-build-action#optimizing-cache-effectiveness arguments: | - -Psemver.main.scope=${{ github.event.inputs.scope }} -Psemver.main.stage=${{ github.event.inputs.stage }} + -Psemver.modifier=${{ github.event.inputs.modifier }} clean build publishToSonatype closeAndReleaseSonatypeStagingRepository githubRelease + --stacktrace env: GITHUB_TOKEN: ${{ github.token }} OSS_USER: '${{ secrets.OSS_USER }}' diff --git a/build-logic/kotlin-convention/src/main/kotlin/build-conventions.gradle.kts b/build-logic/kotlin-convention/src/main/kotlin/build-conventions.gradle.kts index 40daf86..e7d019c 100644 --- a/build-logic/kotlin-convention/src/main/kotlin/build-conventions.gradle.kts +++ b/build-logic/kotlin-convention/src/main/kotlin/build-conventions.gradle.kts @@ -4,20 +4,15 @@ plugins { } semver { - verbose(true) tagPrefix("v") initialVersion("0.0.1") - featureBranchRegex(listOf("[a-zA-Z\\-_0-9]+\\/sc-\\d+\\/[a-zA-Z\\-_0-9]+")) findProperty("semver.overrideVersion")?.toString()?.let { overrideVersion(it) } - - currentBranch { - scope(findProperty("semver.currentBranch.scope")?.toString()) - stage(findProperty("semver.currentBranch.stage")?.toString()) - } + val semVerModifier = findProperty("semver.modifier")?.toString()?.let { buildVersionModifier(it) } ?: { nextPatch() } + versionModifier(semVerModifier) } group = "io.github.nefilim.kjwt" -version = semver.version.value +version = semver.version configure { theme = com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a84f24c..54734f5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ google-kms = "0.94.0" gradle-github-release = "2.2.12" gradle-nexus-publish = "1.1.0" gradle-protobuf-plugin = "0.8.18" -gradle-semver = "0.0.27" +gradle-semver = "0.3.+" gradle-tasktree = "2.1.0" gradle-testlogger = "3.1.0" gradle-versions = "0.39.0"