From 8b92cf2b4dd229bcfc25ac3292657d345122eab7 Mon Sep 17 00:00:00 2001 From: Raphael Vullriede Date: Thu, 29 Jun 2023 14:39:11 +0200 Subject: [PATCH 1/4] enable CI/CD and automated release management --- .idea/compiler.xml | 1 - pom.xml | 79 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 3bb88bc..b4b6f3f 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,7 +7,6 @@ - diff --git a/pom.xml b/pom.xml index 874e25a..de56547 100644 --- a/pom.xml +++ b/pom.xml @@ -31,10 +31,85 @@ org.projectlombok lombok - 1.18.10 + 1.18.28 provided - + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + + attach-javadocs + + jar + + + none + false + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + \ No newline at end of file From b63932ba6e51db083c8581abc8458b592ebfeb9a Mon Sep 17 00:00:00 2001 From: Raphael Vullriede Date: Thu, 29 Jun 2023 14:39:49 +0200 Subject: [PATCH 2/4] enable CI/CD and automated release management --- .github/dependabot.yml | 11 ++++++++ .github/workflows/maven-publish-release.yml | 30 +++++++++++++++++++++ .github/workflows/maven.yml | 23 ++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/maven-publish-release.yml create mode 100644 .github/workflows/maven.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..76e22be --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "maven" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/.github/workflows/maven-publish-release.yml b/.github/workflows/maven-publish-release.yml new file mode 100644 index 0000000..c9fe461 --- /dev/null +++ b/.github/workflows/maven-publish-release.yml @@ -0,0 +1,30 @@ +name: Publish release package to the Maven Central Repository +on: + release: + types: [ created ] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Install gpg secret key + run: | + # Install gpg secret key + cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import + # Verify gpg secret key + gpg --list-secret-keys --keyid-format LONG + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P osslabz-release clean deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..34f4391 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,23 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn --batch-mode --update-snapshots package \ No newline at end of file From 7be877abdc747acfd2bddea13aca6361a7e380a4 Mon Sep 17 00:00:00 2001 From: Raphael Vullriede Date: Thu, 29 Jun 2023 14:42:01 +0200 Subject: [PATCH 3/4] enable CI/CD and automated release management --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 34f4391..3f4af37 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,9 +4,9 @@ name: Java CI with Maven on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] jobs: build: From e66f6b667b49b00c9e2f1d416fd67625a9e756a7 Mon Sep 17 00:00:00 2001 From: Raphael Vullriede Date: Thu, 29 Jun 2023 21:21:31 +0200 Subject: [PATCH 4/4] fix release profile name --- .github/workflows/maven-publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-publish-release.yml b/.github/workflows/maven-publish-release.yml index c9fe461..102cd60 100644 --- a/.github/workflows/maven-publish-release.yml +++ b/.github/workflows/maven-publish-release.yml @@ -24,7 +24,7 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Publish package - run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P osslabz-release clean deploy + run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P release clean deploy env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file