Skip to content

Commit

Permalink
rev semver plugin version and update GHA (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
nefilim authored Feb 23, 2022
1 parent 50c671f commit 749365a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<com.adarshr.gradle.testlogger.TestLoggerExtension> {
theme = com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 749365a

Please sign in to comment.