-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for Github actions building and release
- Add GH actions workflows for Build and Release - Remove maven as build framework - Use JReleaser to release to both Maven Central and GitHub
- Loading branch information
1 parent
da89b9d
commit b6466cc
Showing
10 changed files
with
206 additions
and
777 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build and Test | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'liberica' | ||
|
||
- name: Setup Maven | ||
uses: s4u/[email protected] | ||
with: | ||
githubServer: false | ||
servers: | | ||
[{ | ||
"id": "gemfire-broadcom-repo", | ||
"username": "${{ secrets.SUPPORT_BROADCOM_COM_USERNAME }}", | ||
"password": "${{ secrets.SUPPORT_BROADCOM_COM_PASSWORD }}" | ||
}] | ||
- name: Build and Test | ||
shell: bash | ||
run: | | ||
./mvnw compile test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'liberica' | ||
|
||
- name: Setup Maven | ||
uses: s4u/[email protected] | ||
with: | ||
githubServer: false | ||
servers: | | ||
[{ | ||
"id": "gemfire-broadcom-repo", | ||
"username": "${{ secrets.SUPPORT_BROADCOM_COM_USERNAME }}", | ||
"password": "${{ secrets.SUPPORT_BROADCOM_COM_PASSWORD }}" | ||
},{ | ||
"id": "central", | ||
"username": "${{ secrets.SONATYPE_ROBOT_USERNAME }}", | ||
"password": "${{ secrets.SONATYPE_ROBOT_PASSWORD }}" | ||
}] | ||
- name: Build and Test | ||
shell: bash | ||
env: | ||
MAVEN_GPG_KEY_FINGERPRINT: ${{ secrets.SIGNING_KEY_ID }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
run: | | ||
set -e -o pipefail | ||
echo -n '${{ secrets.SIGNING_KEY_TGZ }}' | base64 -d | tar zxf - -C ${HOME} --exclude '*.lock' | ||
RELEASE_RC=0 | ||
./gradlew -x test build publish jRelease --stacktrace || RELEASE_RC=$? | ||
rm -rf ${HOME}/.gnupg | ||
exit $RELEASE_RC | ||
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,16 @@ plugins { | |
id 'java-library' | ||
id 'distribution' | ||
id 'maven-publish' | ||
id 'org.jreleaser' version '1.16.0' | ||
} | ||
|
||
// COMPILE THINGS //////////////////////////////////////////// | ||
|
||
import groovy.xml.* | ||
import org.gradle.util.VersionNumber | ||
|
||
final jbossModuleName = "${project.group}.${project.name}:${VersionNumber.parse(project.version).major}" | ||
|
||
targetCompatibility = '1.8' | ||
|
||
group 'dev.gemfire' | ||
|
@@ -26,48 +34,13 @@ repositories { | |
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
pom { | ||
name = "${project.group}:${project.name}" | ||
description = 'A collection of distributed types for use wih GemFire' | ||
url = 'https://github.com/gemfire/gemfire-distributed-typed' | ||
developers { | ||
developer { | ||
name = 'Jens Deppe' | ||
email = '[email protected]' | ||
organization = 'Broadcom' | ||
organizationUrl = 'https://broadcom.com' | ||
} | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
scm { | ||
url = 'https://github.com/gemfire/gemfire-distributed-types' | ||
connection = 'scm:git:git://github.com/gemfire/gemfire-distributed-types.git' | ||
developerConnection = 'scm:git:ssh://github.com:gemfire/gemfire-distributed-types.git' | ||
} | ||
} | ||
|
||
from components.java | ||
} | ||
} | ||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "Broadcom" | ||
url = project.findProperty("publishRepository") | ||
credentials { | ||
username = System.getenv("PUBLISH_MAVEN_USERNAME") | ||
password = System.getenv("PUBLISH_MAVEN_PASSWORD") | ||
} | ||
} | ||
} | ||
test { | ||
useJUnit() | ||
} | ||
|
||
configurations { | ||
|
@@ -89,20 +62,6 @@ dependencies { | |
testImplementation('com.vmware.gemfire:gemfire-dunit:10.1.1') | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
test { | ||
useJUnit() | ||
} | ||
|
||
import groovy.xml.* | ||
import org.gradle.util.VersionNumber | ||
|
||
final jbossModuleName = "${project.group}.${project.name}:${VersionNumber.parse(project.version).major}" | ||
|
||
tasks.register("generateModuleXml") { task -> | ||
final file = file(task.temporaryDir.toPath().resolve("module.xml")) | ||
doLast { | ||
|
@@ -127,6 +86,8 @@ tasks.register("generateModuleXml") { task -> | |
outputs.file(file) | ||
} | ||
|
||
// BUNDLING THINGS //////////////////////////////// | ||
|
||
distributions { | ||
extension { | ||
distributionBaseName = distributionPrefix | ||
|
@@ -144,6 +105,97 @@ distributions { | |
} | ||
} | ||
|
||
// RELEASE THINGS //////////////////////////////// | ||
|
||
jreleaser { | ||
project { | ||
description = 'GemFire Distributed Types' | ||
copyright = 'Copyright 2024 Broadcom. All rights reserved.' | ||
website = 'must not be blank' | ||
docsUrl = 'must not be blank' | ||
license = 'must not be blank' | ||
authors = ['must not be blank'] | ||
} | ||
signing { | ||
active = 'ALWAYS' | ||
armored = true | ||
verify = false | ||
mode = 'COMMAND' | ||
} | ||
|
||
deploy { | ||
maven { | ||
mavenCentral { | ||
sonatype { | ||
active = 'ALWAYS' | ||
url = 'https://central.sonatype.com/api/v1/publisher' | ||
stagingRepository('build/staging-deploy') | ||
applyMavenCentralRules = true | ||
stage = 'UPLOAD' | ||
} | ||
} | ||
} | ||
} | ||
|
||
distributions { | ||
extension { | ||
distributionType = 'BINARY' | ||
artifact { | ||
path = 'build/distributions/gemfire-distributed-types-0.1.2.gfm' | ||
} | ||
} | ||
} | ||
|
||
release { | ||
github { | ||
repoOwner = 'gemfire' | ||
name = 'gemfire-distributed-types' | ||
draft = true | ||
skipTag = false | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
pom { | ||
name = "${project.group}:${project.name}" | ||
description = 'A collection of distributed types for use wih GemFire' | ||
url = 'https://github.com/gemfire/gemfire-distributed-typed' | ||
developers { | ||
developer { | ||
name = 'Jens Deppe' | ||
email = '[email protected]' | ||
organization = 'Broadcom' | ||
organizationUrl = 'https://broadcom.com' | ||
} | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
scm { | ||
url = 'https://github.com/gemfire/gemfire-distributed-types' | ||
connection = 'scm:git:git://github.com/gemfire/gemfire-distributed-types.git' | ||
developerConnection = 'scm:git:ssh://github.com:gemfire/gemfire-distributed-types.git' | ||
} | ||
} | ||
|
||
from components.java | ||
artifact tasks.named('extensionDistZip') | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = layout.buildDirectory.dir('staging-deploy') | ||
} | ||
} | ||
} | ||
|
||
extensionDistZip { | ||
eachFile { file -> | ||
String path = file.relativePath | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.