Skip to content

Commit

Permalink
Cleanup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Mar 30, 2024
1 parent 7f3920f commit c07112a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 56 deletions.
24 changes: 24 additions & 0 deletions .github/actions/setup-gradle-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Gradle
description: Sets up the environment to run Gradle

runs:
using: composite

steps:
- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- uses: gradle/wrapper-validation-action@v2

- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true # https://github.com/gradle/gradle-build-action/issues/630
14 changes: 1 addition & 13 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ jobs:
with:
fetch-depth: 0

- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- uses: gradle/wrapper-validation-action@v2

- uses: gradle/actions/setup-gradle@v3
- uses: ./.github/actions/setup-gradle-build

- run: ./gradlew assemble

Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@ jobs:
with:
fetch-depth: 0

- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
printf "org.gradle.parallel=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- uses: gradle/actions/setup-gradle@v3
- uses: ./.github/actions/setup-gradle-build

- name: Unwrap GPG key
env:
Expand Down
30 changes: 2 additions & 28 deletions .github/workflows/publish_snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,7 @@ jobs:
with:
fetch-depth: 0

- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
printf "org.gradle.parallel=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- name: Build app with Gradle
uses: gradle/actions/setup-gradle@v3
- uses: ./.github/actions/setup-gradle-build

- run: ./gradlew assemble

Expand All @@ -59,19 +45,7 @@ jobs:
with:
fetch-depth: 0

- name: Write Gradle build properties to `~/.gradle/gradle.properties`
run: |
mkdir -p ~/.gradle
printf "org.gradle.jvmargs=-Xmx3G -XX:+UseParallelGC\n" >> ~/.gradle/gradle.properties
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21

- uses: gradle/actions/setup-gradle@v3
- uses: ./.github/actions/setup-gradle-build

- run: ./gradlew assemble -PskipJarVersion

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
java-compilation = "21"
java-compilation = "22"
gradle-starter = "0.71.0"
gradle-pluginpublish = "1.2.1"
maven-kotlin = "1.9.23"
Expand Down

0 comments on commit c07112a

Please sign in to comment.