Merge pull request #1057 from pylonmc/balugaq/fix-drill-and-breaker #1987
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI with Gradle | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "*" ] | |
| workflow_call: | |
| inputs: | |
| version: | |
| default: ${{ github.run_number }} | |
| required: false | |
| type: string | |
| jobs: | |
| build: | |
| if: startsWith(github.event.head_commit.message, '[Skip]') == false | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Get commit of rebar to use | |
| id: parseref | |
| if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, '[ref:') | |
| run: | | |
| PARSED_REF=$(echo "${{ github.event.pull_request.title }}" | sed -n 's/.*\[ref:\([^]]*\)\].*/\1/p') | |
| echo "ref=$PARSED_REF" >> $GITHUB_OUTPUT | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Clone master project | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: 'pylonmc/parallel-dev-repo' | |
| - name: Set up gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Clone rebar | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: 'pylonmc/rebar' | |
| ref: ${{steps.rebarcommit.outputs.ref}} # empty string if ref not found falls back to master | |
| path: 'parallel-dev-repo/rebar' | |
| - name: Clone pylon | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: 'pylonmc/pylon' | |
| ref: ${{github.sha}} | |
| path: 'parallel-dev-repo/pylon' | |
| - name: Build with Gradle Wrapper | |
| run: | | |
| ./gradlew :pylon:shadowJar -Pversion=${{ inputs.version || github.run_number }} | |
| - name: Upload the artifact | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: pylon-${{ inputs.version || github.run_number }} | |
| path: 'pylon/build/libs/pylon-${{ inputs.version || github.run_number }}.jar' | |
| dependency-submission: | |
| needs: [build] | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Generate and submit dependency graph | |
| uses: gradle/actions/dependency-submission@v6 |