update build gradle #4
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: Build and Publish | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-publish: | |
| name: Build and Publish to Maven Central | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Install GCC | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc build-essential | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build project with natives | |
| run: ./gradlew build -PNATIVE_ARCH=linux-x64 -x test | |
| - name: Verify JAR contents | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| echo "Verifying JAR for version $VERSION..." | |
| jar tf build/libs/flecs-java-$VERSION.jar | grep "natives/linux-x64/libflecs.so" && echo "✓ Native library found" || echo "✗ Native NOT found" | |
| jar tf build/libs/flecs-java-$VERSION.jar | grep "META-INF/services/javax.annotation.processing.Processor" && echo "✓ Processor found" || echo "✗ Processor NOT found" | |
| - name: Publish to Maven Central | |
| env: | |
| OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -PNATIVE_ARCH=linux-x64 |