Skip to content

Commit

Permalink
feat!: update gradle to 8.5 (#92202)
Browse files Browse the repository at this point in the history
* update gradle to 8.5
* using JavaToolChain with Java 17
* replaced calls to deprecated code where possible
* removed scmversion-plugin
* removed detekt-plugin
* now using .github actions
* updated documentation
  • Loading branch information
skiesewetter-intershop committed Jan 10, 2024
1 parent d243470 commit 98afeed
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 906 deletions.
55 changes: 9 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,20 @@ name: Run build and tests
on:
push:
branches:
- '*'
- '**'
pull_request:
branches: [ master ]

jobs:
build:
permissions:
checks: write
pull-requests: write
contents: read
environment: CIRelease
runs-on: ubuntu-latest

steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: git fetch --all --tags

- name: Create .gradle dir
run: mkdir -p $HOME/.gradle
- name: Install gpg secret key
env:
SIGNINGFILE: ${{ secrets.SIGNINGFILE }}
run: |
cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Export gpg file
env:
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
run: |
gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg
- name: Create gradle sproperties
env:
APIKEY: ${{ secrets.APIKEY }}
APISECRET: ${{ secrets.APISECRET }}
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
SONATYPEUSER: ${{ secrets.SONATYPEUSER }}
run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties
- name: Build and test with Gradle
env:
JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M"
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
run: ./gradlew test build -s
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: build/test-results/**/*.xml
- name: Post Build
run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json
- name: Setup
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0
- name: Build
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-build@v1.0
64 changes: 17 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,26 @@ name: Run release build from tag
on:
push:
tags:
- '*'
- '**'

jobs:
release:
build:
permissions:
checks: write
pull-requests: write
contents: read
environment: CIRelease
runs-on: ubuntu-latest

steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: git fetch --all --tag
- name: Create .gradle dir
run: mkdir -p $HOME/.gradle
- id: install-secret-key
name: Install gpg secret key
env:
SIGNINGFILE: ${{ secrets.SIGNINGFILE }}
run: |
cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- id: export-gpg-file
name: Export gpg file
env:
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
run: |
gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg
- name: Create gradle sproperties
env:
APIKEY: ${{ secrets.APIKEY }}
APISECRET: ${{ secrets.APISECRET }}
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
SONATYPEUSER: ${{ secrets.SONATYPEUSER }}
run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties
- name: Run gradle release
env:
JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M"
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
run: ./gradlew -PrunOnCI=true test build :publishIntershopMvnPublicationToMavenRepository :publishPlugins -s
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
- name: Setup
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0
- name: Release
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-release@v1.0
with:
files: build/test-results/**/*.xml
- name: Post Build
run: rm -f $HOME/.gradle/gradle.properties
signing-file: ${{ secrets.SIGNINGFILE }}
signing-key-id: ${{ secrets.SIGNINGKEYID }}
signing-password: ${{ secrets.SIGNINGPASSWORD }}
api-key: ${{ secrets.APIKEY }}
api-secret: ${{ secrets.APISECRET }}
sonatype-user: ${{ secrets.SONATYPEUSER }}
sonatype-password: ${{ secrets.SONATYPEPASSWORD }}
15 changes: 11 additions & 4 deletions README.asciidoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
= Escrow Package Plugin
:latestRevision: 1.0.0
:latestRevision: 2.0.0

This plugin initialize an ESCROW package. This is a zip file of the root project.
It is possible to exclude files and directories additional for the prepared default excludes.

==== Usage
== Usage
To use the Gradle escrow plugin. include the following in your build script:

[source,groovy,subs="attributes"]
Expand All @@ -20,10 +20,10 @@ escrow {
This plugin can be applied only to the root project. It produces a zip package with all the sources and without
Gradle wrapper directory, which will be published to the specified repository.

==== Extension
== Extension
This plugin adds an extension *`escrow`* to the project.

==== Properties
=== Properties

[cols="17%,17%,17%,68%", width="90%, options="header"]
|===
Expand All @@ -50,7 +50,14 @@ This list can be manipulated with the following methods:
|*exclude* | `void` | String | Add an additional exclude pattern to the exclude list.
|*excludes* | `void` | List<String> | Add all elements of the parameter list to the exclude list.
|*excludes*| `void` | List<String> | Reset the default exclude list with the parameter list.
|===

== Tasks

[cols="26%,33%,40%", width="99%, options="header"]
|===
| Task name | Class |Description
| *escrowZip* | `org.gradle.api.tasks.bundling.Zip` | Creates an escrow source package from project.
|===

== License
Expand Down

0 comments on commit 98afeed

Please sign in to comment.