Complex sample players placeholders for server list ping #2372
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
| # This workflow will build a Java project with Gradle | |
| # For more information see: https://docs.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
| name: Java CI with Gradle | |
| on: | |
| push: | |
| branches: | |
| - libdeflate | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| RELEASE_BRANCH: refs/heads/libdeflate | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'zulu' | |
| - name: Generate Release Tag | |
| if: github.ref == env.RELEASE_BRANCH | |
| id: release_tag | |
| run: | | |
| # Fetch all tags from remote | |
| git fetch --tags | |
| # Get the latest build number from existing releases | |
| LATEST_BUILD=0 | |
| # Check if there are existing build tags and find the highest number | |
| if git tag | grep -E "^build-[0-9]+$" > /dev/null; then | |
| LATEST_BUILD=$(git tag | grep -E "^build-[0-9]+$" | sed 's/build-//' | sort -n | tail -1) | |
| fi | |
| # Debug output | |
| echo "All tags:" | |
| git tag | |
| echo "Build tags found:" | |
| git tag | grep -E "^build-[0-9]+$" || echo "No build tags found" | |
| echo "Latest build number found: $LATEST_BUILD" | |
| # Increment the build number | |
| NEW_BUILD=$((LATEST_BUILD + 1)) | |
| echo "tag=build-$NEW_BUILD" >> $GITHUB_OUTPUT | |
| echo "build_nr=$NEW_BUILD" >> $GITHUB_OUTPUT | |
| echo "Generated tag: build-$NEW_BUILD" | |
| echo "Previous highest build: $LATEST_BUILD" | |
| echo "New build number: $NEW_BUILD" | |
| - name: Build with Gradle | |
| env: | |
| BUILD_NUMBER: ${{ steps.release_tag.outputs.build_nr }} | |
| run: ./gradlew build | |
| - name: Rename Velocity-CTD Fat Jar | |
| if: github.ref == env.RELEASE_BRANCH | |
| run: | | |
| JAR=$(ls proxy/build/libs/velocity-proxy-*-all.jar) | |
| VERSION=$(echo "$JAR" | sed 's|proxy/build/libs/velocity-proxy-||' | sed 's|-all\.jar||') | |
| cp "$JAR" "proxy/build/libs/velocity-ctd-fatjar-$VERSION-${{ steps.release_tag.outputs.build_nr }}.jar" | |
| - name: Rename Velocity-CTD Bootstrap Jar | |
| if: github.ref == env.RELEASE_BRANCH | |
| run: | | |
| JAR=$(ls bootstrap/build/libs/velocity-bootstrap-*.jar | grep -v -- '-sources\.jar') | |
| VERSION=$(echo "$JAR" | sed 's|bootstrap/build/libs/velocity-bootstrap-||' | sed 's|\.jar||') | |
| cp "$JAR" "bootstrap/build/libs/velocity-ctd-$VERSION-${{ steps.release_tag.outputs.build_nr }}.jar" | |
| - name: Publish to Maven Repository | |
| if: github.ref == env.RELEASE_BRANCH | |
| continue-on-error: true | |
| env: | |
| BUILD_NUMBER: ${{ steps.release_tag.outputs.build_nr }} | |
| ORG_GRADLE_PROJECT_velocityctdUser: ${{ secrets.MAVEN_USERNAME }} | |
| ORG_GRADLE_PROJECT_velocityctdPassword: ${{ secrets.MAVEN_PASSWORD }} | |
| run: ./gradlew publish | |
| - name: Upload as GitHub Release | |
| if: github.ref == env.RELEASE_BRANCH | |
| continue-on-error: true | |
| uses: marvinpinto/action-automatic-releases@master | |
| with: | |
| title: "Velocity-CTD" | |
| automatic_release_tag: "${{ steps.release_tag.outputs.tag }}" | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| files: | | |
| proxy/build/libs/velocity-ctd-fatjar-*-${{ steps.release_tag.outputs.build_nr }}.jar | |
| bootstrap/build/libs/velocity-ctd-*-${{ steps.release_tag.outputs.build_nr }}.jar | |
| prerelease: false |