Build fixes‽ #430
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: Parse [ref title | |
| id: parseref | |
| if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, '[ref:') | |
| run: | | |
| prefixrm=$(echo "${{github.event.pull_request.title}}" | cut -c6-) | |
| BRANCHNAME=$(echo "$prefixrm" | cut -d']' -f1) | |
| git clone https://github.com/pylonmc/pylon-core.git | |
| cd pylon-core | |
| echo "CORECOMMIT=$(git rev-parse origin/$(echo "$BRANCHNAME"))" >> $GITHUB_ENV | |
| cd .. | |
| rm -rf pylon-core | |
| - name: Parse [commit title | |
| id: parsecommit | |
| if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, '[commit:') | |
| run: | | |
| prefixrm=$(echo "${{github.event.pull_request.title}}" | cut -c9-) | |
| echo "CORECOMMIT=$(echo "$prefixrm" | cut -d']' -f1)" >> $GITHUB_ENV | |
| - name: Get latest commit of core master | |
| if: steps.parseref.outcome == 'skipped' && steps.parsecommit.outcome == 'skipped' | |
| run: | | |
| git clone https://github.com/pylonmc/pylon-core.git | |
| cd pylon-core | |
| echo "CORECOMMIT=$(git rev-parse origin/master)" >> $GITHUB_ENV | |
| cd .. | |
| rm -rf pylon-core | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4.6.0 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4.2.2 | |
| - name: Clone master project | |
| run: | | |
| git clone https://github.com/pylonmc/pylon.git | |
| cd pylon | |
| ./gradlew | |
| cd core | |
| git fetch origin $(echo "$CORECOMMIT") | |
| git checkout $(echo "$CORECOMMIT") | |
| cd ../base | |
| git fetch origin ${{ github.sha }} | |
| git checkout ${{ github.sha }} | |
| - name: Build with Gradle Wrapper | |
| run: | | |
| cd pylon | |
| ./gradlew :base:shadowJar -Pversion=${{ inputs.version || github.run_number }} | |
| - name: Upload the artifact | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: pylon-base-${{ inputs.version || github.run_number }} | |
| path: 'pylon/base/build/libs/pylon-base-${{ inputs.version || github.run_number }}.jar' | |
| dependency-submission: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4.6.0 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Generate and submit dependency graph | |
| uses: gradle/actions/dependency-submission@v4.2.2 |