-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline various setups of gradle and java into a github action for…
… reuse
- Loading branch information
Showing
3 changed files
with
59 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "setup" | ||
description: "Setups App Version, JDK and Gradle for the project" | ||
author: "Henry Addo" | ||
|
||
inputs: | ||
java-version: | ||
description: "Java version" | ||
default: "21" | ||
java-distribution: | ||
description: "Java distribution" | ||
default: "zulu" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
- name: Setup JDK ${{ inputs.java-version }} from ${{ inputs.java-distribution }} distribution | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: wrapper | ||
- name: Setup Konan cache key # Kotlin native dependencies | ||
id: konan-cache-key | ||
shell: bash | ||
run: echo "KOTLIN_VERSION=$(grep -oE 'kotlin\s*=\s*"[0-9.]*"' gradle/libs.versions.toml | grep -oE '[0-9.]+')" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache Konan # Kotlin native dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.konan | ||
key: v1-konan-${{ runner.os }}-${{ hashFiles('.sdkmanrc') }}-${{ steps.konan-cache-key.outputs.KOTLIN_VERSION }} | ||
- name: Setup App Version Number | ||
shell: bash | ||
run: | | ||
echo "VERSION_NAME=$(./gradlew -q --no-configuration-cache printVersionName)" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Enable auto-env through the sdkman_auto_env config | ||
# See https://sdkman.io/usage#config | ||
# Add key=value pairs of SDKs to use below | ||
# https://sdkman.io/usage#env for usage | ||
java=21.0.2-zulu |