Skip to content

Commit

Permalink
Update Workflows, Add PR Build
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Dec 24, 2024
1 parent 53cf890 commit 3814bc2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/gradle-pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Gradle for Pull Request

on:
pull_request:
branches:
- 1.21.1
- 1.20.1
types:
- synchronize
- opened
- reopened

jobs:
gradle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
cache: gradle

- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build
run: ./gradlew build --scan
22 changes: 7 additions & 15 deletions .github/workflows/gradle-publishtomaven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ name: Gradle Publish to Maven
on:
push:
branches:
- 1.21.1
- 1.20.1
- 1.21.1
- Release

jobs:
gradle:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
Expand All @@ -22,20 +20,14 @@ jobs:
java-version: 21
cache: gradle

- name: Store gradle.properties secrets
env:
MAVEN_REPO_PROPERTIES: ${{ secrets.REPO_LOGIN }}
shell: bash
- name: Configure Gradle secrets
run: |
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
echo "${MAVEN_REPO_PROPERTIES}" > ~/.gradle/gradle.properties
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
echo "${{ secrets.REPO_LOGIN }}" > ~/.gradle/gradle.properties
- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build and Publish to Maven
run: ./gradlew publish publishAllPublicationsToJTDev-Maven-RepositoryRepository
- name: Build and Publish to Maven
run: ./gradlew publish publishAllPublicationsToJTDev-Maven-RepositoryRepository

0 comments on commit 3814bc2

Please sign in to comment.