build.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Automatically build the project and run any configured tests for every push
  2. # and submitted pull request. This can help catch issues that only occur on
  3. # certain platforms or Java versions, and provides a first line of defence
  4. # against bad commits.
  5. name: build
  6. on: [pull_request, push]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. # Use these Java versions
  12. java: [
  13. 1.8, # Minimum supported by Minecraft
  14. 11, # Current Java LTS
  15. 15 # Latest version
  16. ]
  17. # and run on both Linux and Windows
  18. os: [ubuntu-20.04, windows-latest]
  19. runs-on: ${{ matrix.os }}
  20. steps:
  21. - name: checkout repository
  22. uses: actions/checkout@v2
  23. - name: validate gradle wrapper
  24. uses: gradle/wrapper-validation-action@v1
  25. - name: setup jdk ${{ matrix.java }}
  26. uses: actions/setup-java@v1
  27. with:
  28. java-version: ${{ matrix.java }}
  29. - name: make gradle wrapper executable
  30. if: ${{ runner.os != 'Windows' }}
  31. run: chmod +x ./gradlew
  32. - name: build
  33. run: ./gradlew build
  34. - name: capture build artifacts
  35. if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
  36. uses: actions/upload-artifact@v2
  37. with:
  38. name: Artifacts
  39. path: build/libs/