gradle.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # This Action will build the SDK and if this succeeds, trigger a build on the
  2. # jMonkeyEngine/sdk-update-center repository, so that nbms get built and
  3. # deployed
  4. name: Nightly NBM Deployment
  5. on:
  6. push:
  7. branches: [ master ]
  8. pull_request:
  9. jobs:
  10. BuildSDK:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Set up JDK 21
  15. uses: actions/setup-java@v3
  16. with:
  17. java-version: 21
  18. distribution: 'temurin'
  19. - name: Validate the Gradle wrapper
  20. uses: gradle/wrapper-validation-action@v2
  21. - name: Grant execute permission for gradle
  22. run: chmod +x gradlew
  23. - name: Build the SDK
  24. run: ./gradlew buildSdk
  25. NBMDeployment:
  26. needs: [BuildSDK]
  27. runs-on: ubuntu-latest
  28. if: github.event_name == 'push'
  29. steps:
  30. - name: Checkout the nightly-trigger repository
  31. uses: actions/checkout@v3
  32. with:
  33. repository: 'jMonkeyEngine/sdk-update-center'
  34. ref: nightly
  35. path: nightly
  36. token: ${{ secrets. UPDATE_CENTER_PAT }}
  37. - name: Setup Git for the commit
  38. run: git config user.email [email protected] && git config user.name MeFisto94
  39. working-directory: nightly
  40. - name: Overwrite the target file
  41. run: rm -rf nightly/target && echo 'echo "sdk_sha=${{ github.sha }}" >> $GITHUB_ENV' > nightly/target
  42. - name: Trigger nightly builds
  43. working-directory: nightly
  44. run: git add target && git commit -m "Trigger a fresh nightly build for https://github.com/jMonkeyEngine/sdk/commit/${{ github.sha }}" && git push