Skip to content

Commit

Permalink
build(ci): Update workflows to use official Gradle setup action (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
leviem1 authored May 28, 2024
1 parent 222240d commit 2db9bfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
5 changes: 2 additions & 3 deletions .github/actions/common-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ runs:
java-version: ${{ inputs.java-version }}
distribution: 'zulu'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
shell: bash
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
24 changes: 2 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
branches:
- 'main'
schedule:
# PaperMC doesn't change version numbers for latest releases meaning the build may break
# unexpectedly. Build every so often so that we know if a breaking change has been published
- cron: '0 0 * * 6'
workflow_dispatch:

Expand All @@ -28,16 +30,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Common Setup
uses: ./.github/actions/common-setup
with:
Expand Down Expand Up @@ -75,16 +67,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Common Setup
uses: ./.github/actions/common-setup
with:
Expand Down Expand Up @@ -122,8 +104,6 @@ jobs:

- name: Common Setup
uses: ./.github/actions/common-setup
with:
java-version: 21

- name: Publish with Gradle
run: ./gradlew -Pver=${{ env.RELEASE_TAG }} release
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:

- name: Common Setup
uses: ./.github/actions/common-setup
with:
java-version: 21

- name: Retrieve Project Name
run: echo "PROJECT_NAME=$(${{github.workspace}}/gradlew -q printProjectName)" >> $GITHUB_ENV
Expand Down

0 comments on commit 2db9bfe

Please sign in to comment.