Add core-jar-path cmdline arg #394
Workflow file for this run
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}} | sed 's/^[ref://') | |
| suffixrm=$(echo "$prefixrm" | sed 's/\].*$//') | |
| BRANCHNAME=$(echo "$suffixrm" | sed 's/\]//g') | |
| git clone https://github.com/pylonmc/pylon-core.git | |
| cd pylon-core | |
| echo "CORECOMMIT=$(git rev-parse origin/$BRANCHNAME)" >> $GITHUB_ENV | |
| cd .. | |
| rm -rf pylon-core | |
| echo "$CORECOMMIT" | |
| - 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}} | sed 's/^[commit://') | |
| suffixrm=$(echo $prefixrm | sed 's/\].*$//') | |
| echo "CORECOMMIT=$(echo $suffixrm | sed 's/\]//g')" >> $GITHUB_ENV | |
| echo "$CORECOMMIT" | |
| - 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 | |
| echo "$CORECOMMIT" | |
| - name: (debug) echo core commit hash | |
| run: echo "$CORECOMMIT" | |
| - 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: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4.2.2 | |
| - name: Download core | |
| id: downloadcore | |
| uses: actions/download-artifact@v4.1.8 | |
| continue-on-error: true | |
| with: | |
| name: pylon-core-${{env.CORECOMMIT}} | |
| repository: pylonmc/pylon-core | |
| path: pylon-core-${{env.CORECOMMIT}}.jar | |
| - name: Build core if artifact expired or not found | |
| if: steps.downloadcore.outcome == 'failure' | |
| run: | | |
| git clone https://github.com/pylonmc/pylon-core.git | |
| cd pylon-core | |
| git fetch origin $(echo "$CORECOMMIT") | |
| git checkout $(echo "$CORECOMMIT") | |
| ./gradlew publishToMavenLocal | |
| cp pylon-core/build/libs/core-SNAPSHOT.jar .. | |
| cd .. | |
| rm -rf pylon-core | |
| - name: Build with Gradle Wrapper | |
| run: ./gradlew shadowJar -Pversion=${{ inputs.version || github.run_number }} -Pcore-jar-path=core-SNAPSHOT.jar | |
| - name: Upload the artifact | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: pylon-base-${{ inputs.version || github.run_number }} | |
| path: '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 |