Skip to content

Commit

Permalink
chore: Bump dependencies and release config
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Vitale <[email protected]>
  • Loading branch information
ThomasVitale committed Mar 24, 2024
1 parent cc76d92 commit 852173e
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 91 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/commit-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,52 @@ jobs:
name: Build
runs-on: ubuntu-22.04
permissions:
contents: read
security-events: write
contents: write
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Compile and test
run: ./gradlew build
run: ./gradlew build -Dorg.gradle.parallel=false

- name: Generate SBOMs
run: ./gradlew cyclonedxBom

- name: Publish snapshot artifacts
- name: Stage artifacts to local directory
if: ${{ github.ref == 'refs/heads/main' }}
run: ./gradlew publish

- name: Deploy and release artifacts
if: ${{ github.ref == 'refs/heads/main' }}
run: |
VERSION=$(./gradlew properties | grep 'version:' | awk '{print $2}')
if [[ $VERSION == *"SNAPSHOT"* ]]; then
./gradlew publishAllPublicationsToSonatypeSnapshotRepository
./gradlew jreleaserDeploy
else
./gradlew jreleaserFullRelease
fi
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
SIGNING_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_TOKEN: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-output
path: |
build/jreleaser/trace.log
build/jreleaser/output.properties
35 changes: 0 additions & 35 deletions .github/workflows/release-stage.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# See https://sdkman.io/usage#config
# A summary is to add the following to ~/.sdkman/etc/config
# sdkman_auto_env=true
java=21.0.2-tem
java=22-tem
61 changes: 61 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id 'org.jreleaser' version '1.11.0'
}

// JReleaser requires this task in the root project.
tasks.register("clean", Delete.class) {
group 'build'
delete 'build'
}

jreleaser {
project {
name = "arconia"
description = "Java framework to build SaaS, multitenant applications"
authors = ["Thomas Vitale"]
tags = ['spring-boot', 'multitenancy', 'saas']
maintainers = ['ThomasVitale']
license = 'Apache-2.0'
inceptionYear = "2024"
copyright = '#{project.inceptionYear} #{project.authors}'
}

checksum {
algorithm('SHA-256')
algorithm('SHA-512')
}

signing {
active = 'ALWAYS'
armored = true
}

deploy {
maven {
nexus2 {
'maven-central' {
active = 'ALWAYS'
applyMavenCentralRules = true
url = 'https://s01.oss.sonatype.org/service/local'
snapshotUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
closeRepository = true
releaseRepository = true
stagingRepository('build/staging-deploy')
}
}
}
}

release {
github {
repoOwner = 'arconia-io'
releaseName = '{{tagName}}'

changelog {
formatted = 'ALWAYS'
preset = 'conventional-commits'
extraProperties.put('categorizeScopes', true)
}
}
}
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {

ext {
set("cycloneDxVersion", '1.8.2')
set("springBootVersion", '3.2.2')
set("springBootVersion", '3.2.4')
set("springJavaFormatVersion", '0.0.41')
set("dependencyManagementVersion", '1.1.4')
}
Expand Down
2 changes: 0 additions & 2 deletions buildSrc/src/main/groovy/java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
id 'io.arconia.optional-dependencies'
}

group = 'io.arconia'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
Expand Down
33 changes: 3 additions & 30 deletions buildSrc/src/main/groovy/release-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
plugins {
id 'maven-publish'
id 'signing'
}

java {
withSourcesJar()
withJavadocJar()
withSourcesJar()
}

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
options.addStringOption("Xdoclint:none", "-quiet")
}

Expand Down Expand Up @@ -50,7 +46,7 @@ publishing {
}

scm {
connection = "scm:git:git://github.com/arconia-io/arconia.git"
connection = "scm:git:https://github.com/arconia-io/arconia.git"
developerConnection = "scm:git:ssh://github.com/arconia-io/arconia.git"
url = "https://github.com/arconia-io/arconia"
}
Expand All @@ -60,30 +56,7 @@ publishing {

repositories {
maven {
name = "SonatypeSnapshot"
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"

credentials {
username = findProperty("mavenCentralUsername") ?: System.getenv("MAVEN_CENTRAL_USERNAME")
password = findProperty("mavenCentralToken") ?: System.getenv("MAVEN_CENTRAL_TOKEN")
}
}
maven {
name = "SonatypeStaging"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username = findProperty("mavenCentralUsername") ?: System.getenv("MAVEN_CENTRAL_USERNAME")
password = findProperty("mavenCentralToken") ?: System.getenv("MAVEN_CENTRAL_TOKEN")
}
url = rootProject.layout.buildDirectory.dir('staging-deploy')
}
}
}

signing {
required { gradle.taskGraph.hasTask("publishAllPublicationsToSonatypeStagingRepository") }
def signingSecretKey = findProperty('signingSecretKey') ?: System.getenv("SIGNING_SECRET_KEY")
def signingPassphrase = findProperty('signingPassphrase') ?: System.getenv("SIGNING_PASSPHRASE")
useInMemoryPgpKeys(signingSecretKey, signingPassphrase)
sign publishing.publications.mavenJava
}
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
version=0.0.2-SNAPSHOT
group=io.arconia
version=0.1.0-SNAPSHOT

org.gradle.parallel=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.gradle.toolchains.foojay-resolver-convention" version '0.7.0'
id "org.gradle.toolchains.foojay-resolver-convention" version '0.8.0'
}

rootProject.name = 'arconia'
Expand Down

0 comments on commit 852173e

Please sign in to comment.