From 2c8ad6b585783962d21c48d92f6d980ca0dadcfd Mon Sep 17 00:00:00 2001 From: turikhay Date: Tue, 12 Nov 2024 11:43:53 +0500 Subject: [PATCH] Try to setup Gradle as a composite action --- .github/actions/setup_gradle.yml | 15 +++++++++++++++ .github/workflows/build.yml | 9 +++++---- .github/workflows/nightly.yml | 1 + .github/workflows/update-pages.yml | 6 +----- .github/workflows/update-versions-cf.yml | 6 +----- 5 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 .github/actions/setup_gradle.yml diff --git a/.github/actions/setup_gradle.yml b/.github/actions/setup_gradle.yml new file mode 100644 index 0000000..48cc825 --- /dev/null +++ b/.github/actions/setup_gradle.yml @@ -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 }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e9d7de..199a272 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7d98113..f68e849 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -28,3 +28,4 @@ jobs: uses: ./.github/workflows/build.yml with: version: ${{ needs.prepare.outputs.version }} + dependency-graph: generate-and-submit diff --git a/.github/workflows/update-pages.yml b/.github/workflows/update-pages.yml index a3bd62c..8df3335 100644 --- a/.github/workflows/update-pages.yml +++ b/.github/workflows/update-pages.yml @@ -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 \ diff --git a/.github/workflows/update-versions-cf.yml b/.github/workflows/update-versions-cf.yml index c37e786..b65ce23 100644 --- a/.github/workflows/update-versions-cf.yml +++ b/.github/workflows/update-versions-cf.yml @@ -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 \