Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,31 @@ This action will set up the Java SDK.
#### Example:

```yaml
- uses: aboutbits/github-actions-java/setup@v2
- uses: aboutbits/github-actions-java/setup@v3
```

#### Inputs

The following inputs can be used as `step.with` keys:

| Name | Required/Default | Description |
|------------------------|------------------|---------------------------|
| `working-directory` | `.` | The working directory |
| `java-version` | `21` | Java Version |
| `distribution` | `corretto` | Java Distribution |
| Name | Required/Default | Description |
|---------------------|------------------------|------------------------------------------------------------------|
| `working-directory` | `.` | The working directory |
| `java-version` | `21` | Java Version |
| `distribution` | `corretto` | Java Distribution |
| `cache` | `true` | Enable Maven dependency caching. |
| `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. |

#### Outputs

The following outputs are forwarded from the underlying `setup-java` and `cache` actions:

| Name | Description |
|----------------|-----------------------------------------------------------------------------|
| `distribution` | Distribution of Java that has been installed. |
| `version` | Actual version of the java environment that has been installed. |
| `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
| `cache-hit` | A boolean value to indicate an exact match was found for the primary key. |

### Setup Java and Install Dependencies

Expand All @@ -31,43 +44,57 @@ This action will set up the Java SDK and install all dependencies.
#### Example:

```yaml
- uses: aboutbits/github-actions-java/setup-and-install@v2
- uses: aboutbits/github-actions-java/setup-and-install@v3
```

#### Inputs

The following inputs can be used as `step.with` keys:

| Name | Required/Default | Description |
|------------------------|------------------|---------------------------|
| `working-directory` | `.` | The working directory |
| `java-version` | `21` | Java Version |
| `distribution` | `corretto` | Java Distribution |
| Name | Required/Default | Description |
|---------------------|------------------------|------------------------------------------------------------------|
| `working-directory` | `.` | The working directory |
| `java-version` | `21` | Java Version |
| `distribution` | `corretto` | Java Distribution |
| `cache` | `true` | Enable Maven dependency caching. |
| `cache-name` | `aboutbits-setup-java` | Cache name. Caches with the same name will share their contents. |

#### Outputs

The following outputs are forwarded from the underlying `setup-java` and `cache` actions:

| Name | Description |
|----------------|-----------------------------------------------------------------------------|
| `distribution` | Distribution of Java that has been installed. |
| `version` | Actual version of the java environment that has been installed. |
| `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
| `cache-hit` | A boolean value to indicate an exact match was found for the primary key. |

## Versioning

In order to have a versioning in place and working, create lightweight tags that point to the appropriate minor release versions.
In order to have a versioning in place and working, create lightweight tags that point to the appropriate minor release
versions.

Creating a new minor release:

```bash
git tag v2
git tag v3
git push --tags
```

Replacing an already existing minor release:

```bash
git tag -d v2
git push origin :refs/tags/v2
git tag v2
git tag -d v3
git push origin :refs/tags/v3
git tag v3
git push --tags
```

## Information

About Bits is a company based in South Tyrol, Italy. You can find more information about us on [our website](https://aboutbits.it).
About Bits is a company based in South Tyrol, Italy. You can find more information about us
on [our website](https://aboutbits.it).

### Support

Expand Down
34 changes: 32 additions & 2 deletions setup-and-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,48 @@ inputs:
distribution:
default: 'corretto'
description: 'Java Distribution'
cache:
default: 'true'
description: 'Enable Maven dependency caching.'
cache-name:
default: 'aboutbits-setup-java'
description: 'Cache name. Caches with the same name will share their contents.'

outputs:
distribution:
description: 'Distribution of Java that has been installed.'
value: ${{ steps.setup-java.outputs.distribution }}
version:
description: 'Actual version of the java environment that has been installed.'
value: ${{ steps.setup-java.outputs.version }}
path:
description: 'Path to where the java environment has been installed (same as $JAVA_HOME).'
value: ${{ steps.setup-java.outputs.path }}
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key.'
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Set up JDK
uses: actions/setup-java@v4
id: setup-java
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.distribution }}
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
id: cache
if: ${{ inputs.cache == 'true' }}
with:
path: ~/.m2/repository
key: ${{ inputs.cache-name }}-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ inputs.cache-name }}-${{ runner.os }}-maven-

- name: Update maven dependencies
working-directory: ${{ inputs.working-directory }}
run: ./mvnw --batch-mode --fail-fast dependency:resolve
run: ./mvnw --batch-mode --fail-fast dependency:resolve dependency:resolve-plugins
shell: bash
32 changes: 31 additions & 1 deletion setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,43 @@ inputs:
distribution:
default: 'corretto'
description: 'Java Distribution'
cache:
default: 'true'
description: 'Enable Maven dependency caching.'
cache-name:
default: 'aboutbits-setup-java'
description: 'Cache name. Caches with the same name will share their contents.'

outputs:
distribution:
description: 'Distribution of Java that has been installed.'
value: ${{ steps.setup-java.outputs.distribution }}
version:
description: 'Actual version of the java environment that has been installed.'
value: ${{ steps.setup-java.outputs.version }}
path:
description: 'Path to where the java environment has been installed (same as $JAVA_HOME).'
value: ${{ steps.setup-java.outputs.path }}
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key.'
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Set up JDK
uses: actions/setup-java@v4
id: setup-java
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.distribution }}
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v4
id: cache
if: ${{ inputs.cache == 'true' }}
with:
path: ~/.m2/repository
key: ${{ inputs.cache-name }}-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ inputs.cache-name }}-${{ runner.os }}-maven-