Skip to content

Commit

Permalink
Support java Formatting and Githuc actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzopalazzo authored Apr 14, 2021
2 parents 91a5740 + d5f5a8c commit a88952f
Show file tree
Hide file tree
Showing 17 changed files with 1,281 additions and 1,236 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: [vincenzopalazzo]
liberapay: vincenzopalazzo
custom: https://material-ui-swing.github.io/material-ui-swing-donations
20 changes: 10 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Java CI
name: build

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
#- name: Verify Java Code Style
# run: ./gradlew verifyGoogleJavaFormat
- name: Build with Gradle
run: ./gradlew compileJava
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish package to the Maven Central Repository

on:
release:
types: [created]
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
#- name: Veryfy Java Code Style
# run: ./gradlew verifyGoogleJavaFormat
- name: Build with Gradle
run: ./gradlew compileJava
- name: Make signature file
run: |
echo "${{secrets.SIGNING_KEY}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
- name: Publish package
run: ./gradlew uploadArchives -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) -PRELEASE_ENABLE=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
13 changes: 7 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
`java-library`
`maven-publish`
signing
id("com.github.sherter.google-java-format") version "0.9"
}

group = project.property("GROUP_ID")!!
Expand All @@ -13,8 +14,9 @@ repositories {

dependencies {
testImplementation("io.github.material-ui-swing:LinkLabelUI:0.0.1-rc1")
testImplementation("io.github.vincenzopalazzo:material-ui-swing:1.1.2-rc1")
testImplementation("io.github.vincenzopalazzo:material-ui-swing:1.1.2-rc2")
}

/*
plugins.withType<JavaPlugin>().configureEach {
configure<JavaPluginExtension> {
Expand All @@ -26,14 +28,15 @@ java {
modularity.inferModulePath.set(true)
}
*/

//TODO I'm using this because I will create a Multi-Release JAR Files
//https://openjdk.java.net/jeps/238
tasks.jar {
manifest {
attributes("Automatic-Module-Name" to project.property("MODULE_NAME").toString())
}
}
/*

tasks{
create<Jar>("sourcesJar") {
archiveClassifier.set("sources")
Expand All @@ -52,7 +55,6 @@ tasks{
}

withType<Jar>().configureEach {
// add META-INF/LICENSE to all created JARs
from("${rootDir}/LICENSE") {
into("META-INF")
}
Expand All @@ -70,8 +72,8 @@ publishing {
repositories {
maven {
credentials {
username = project.property("sonatypeUsername").toString()
password = project.property("sonatypePassword").toString()
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
Expand Down Expand Up @@ -117,4 +119,3 @@ signing {
sign(tasks["sourcesJar"], tasks["javadocJar"])
sign(publishing.publications["SwingSnackBar"])
}
*/
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
PROJECT_VERSION=0.0.2
#PROJECT_VERSION=0.0.2-SNAPSHOT
PROJECT_VERSION=0.0.2-SNAPSHOT
GROUP_ID=io.github.material-ui-swing
MODULE_NAME=io.github.materialuiswing.swingsnackbar

signing.keyId=JEY
signing.password=PASS
signing.secretKeyRingFile=PATH
#signing.keyId=JEY
#signing.password=PASS
#signing.secretKeyRingFile=PATH

sonatypeUsername=USERNAME
sonatypePassword=PASS
#sonatypeUsername=USERNAME
#sonatypePassword=PASS
Loading

0 comments on commit a88952f

Please sign in to comment.