Skip to content

Commit

Permalink
gh-actions: Release version settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sbglasius committed Dec 29, 2023
1 parent baf5951 commit eb1c1ba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
SIGN_PASSWORD: ${{ secrets.SIGNING_PASSPHRASE }}
RELEASE_VERSION: ${{ steps.get_version.outputs.version-without-v }}
with:
arguments: -info -Prelease=true :i18n-enums:publishToSonatype closeAndReleaseSonatypeStagingRepository
arguments: -Pversion=${RELEASE_VERSION} publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Bump patch version by one
uses: flatherskevin/semver-action@v1
id: version
Expand Down
34 changes: 18 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ plugins {
id "maven-publish"
}

allprojects {
ext {
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
isReleaseVersion = !isBuildSnapshot
}

subprojects {

group "dk.glasius"

ext {
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
isReleaseVersion = !isBuildSnapshot
}

repositories {
mavenLocal()
mavenCentral()
Expand All @@ -39,19 +43,17 @@ allprojects {
}
}

if (project.isReleaseVersion) {
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
Expand All @@ -60,7 +62,7 @@ if (project.isReleaseVersion) {
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository

tasks.withType(InitializeNexusStagingRepository).configureEach {
onlyIf { isReleaseVersion }
onlyIf { project.isReleaseVersion }
shouldRunAfter(tasks.withType(Sign))
}

Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title=I18n Enums
projectVersion=6.0.0

version=6.0.0
projectDesc=Adds an annotation usable on Enums to easy add and implement the MessageSourceResolvable interface in an standard way throughout a grails project.
projectUrl=https://github.com/sbglasius/i18n-enums
developers=Søren Berg Glasius, Burt Beckwith, James Daugherty
Expand Down
3 changes: 2 additions & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "org.grails.grails-plugin" version "${grailsGradlePluginVersion}"
id 'maven-publish'
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-logging"
Expand Down Expand Up @@ -28,12 +29,12 @@ groovydoc {
link('http://gorm.grails.org/latest/hibernate/api/', 'grails.gorm', 'grails.orm', 'org.grails.datastore', 'org.grails.orm')
}


publishing {
publications {
maven(MavenPublication) {
artifactId = 'i18n-enums'
groupId = 'dk.glasius'
version = project.version

from components.java

Expand Down

0 comments on commit eb1c1ba

Please sign in to comment.