Skip to content

Commit

Permalink
Try to setup Gradle as a composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
turikhay committed Nov 12, 2024
1 parent ab4f1b6 commit 2c8ad6b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
15 changes: 15 additions & 0 deletions .github/actions/setup_gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Setup Gradle

inputs:
dependency-graph:
required: false
default: generate-and-upload

runs:
using: composite
steps:
- uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
dependency-graph: ${{ inputs.dependency-graph }}
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
task:
type: string
default: build
dependency-graph:
type: string
default: generate-and-upload
outputs:
artifact:
description: Path to the jar artifact
Expand All @@ -34,11 +37,9 @@ jobs:
artifact: ${{ env.ARTIFACT }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/setup_gradle.yml
with:
dependency-graph: generate-and-submit
dependency-graph: ${{ inputs.dependency-graph }}
- name: Determine target Spigot version
id: target
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ jobs:
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.prepare.outputs.version }}
dependency-graph: generate-and-submit
6 changes: 1 addition & 5 deletions .github/workflows/update-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
UPDATE_PAGES: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/setup_gradle.yml
- name: Run tasks
run: |
./gradlew \
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/update-versions-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/setup_gradle.yml
- name: Run tasks
run: |
./gradlew \
Expand Down

0 comments on commit 2c8ad6b

Please sign in to comment.