diff --git a/actions/java-gradle-build-jib/README.md b/actions/java-gradle-build-jib/README.md index 2f79d9b80..bca7e1afd 100644 --- a/actions/java-gradle-build-jib/README.md +++ b/actions/java-gradle-build-jib/README.md @@ -4,15 +4,16 @@ This action builds an image tarball using [Jib Gradle](https://github.com/Google ## Input Parameters -| Name | Required | Default Value | Type | Description | -| ------------------- | :------: | :------------: | :-----: | ------------------------------------------------------------------------------------------------------------- | -| image-artifact-name | ❌ | image-artifact | string | Artifact name to upload tarball image, see | -| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | -| java-version | ❌ | 11 | string | Java version to be installed | -| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | -| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | -| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | -| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | +| Name | Required | Default Value | Type | Description | +| ------------------- | :------: | :------------: | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------- | +| image-artifact-name | ❌ | image-artifact | string | Artifact name to upload tarball image, see | +| java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | +| java-version | ❌ | 11 | string | Java version to be installed | +| gradle-version | ❌ | wrapper | string | [Gradle version](https://github.com/gradle/gradle-build-action#use-a-specific-gradle-version) to be installed | +| gradle-cache | ❌ | true | boolean | Whether Gradle caching is enabled or not | +| working-directory | ❌ | "." | string | Working directory of your Gradle artifacts | +| download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | +| subproject | ❌ | | string | The Gradle subproject for which the tarball image should be built (If not specified, a tarball image for the root project will be built) | ## Usage diff --git a/actions/java-gradle-build-jib/action.yaml b/actions/java-gradle-build-jib/action.yaml index b3a5fe7d8..7b4b5e45f 100644 --- a/actions/java-gradle-build-jib/action.yaml +++ b/actions/java-gradle-build-jib/action.yaml @@ -34,6 +34,9 @@ inputs: description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" required: false default: false + subproject: + description: "The Gradle subproject for which the tarball image should be built (If not specified, a tarball image for the root project will be built)" + required: false runs: using: "composite" steps: @@ -51,7 +54,11 @@ runs: gradle-cache: ${{ inputs.gradle-cache }} - name: Build Docker image - run: ./gradlew --info --stacktrace jibBuildTar --image=${{ inputs.image-name }} -x test + run: | + ./gradlew ${{ inputs.subproject && format('{0}:', inputs.subproject) || '' }}jibBuildTar \ + --info --stacktrace \ + --image=${{ inputs.image-name }} \ + -x test shell: bash working-directory: ${{ inputs.working-directory }} @@ -59,5 +66,5 @@ runs: uses: actions/upload-artifact@v3 with: name: ${{ inputs.image-artifact-name }} - path: build/jib-image.tar + path: ${{ inputs.subproject && format('{0}/', inputs.subproject) || '' }}build/jib-image.tar retention-days: 1