diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..22d66e9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: build +on: + push: + # Perform this workflow if the action is a 'push' and just in the 'main' branch. + branches: [main] + pull_request: + # Perform this workflow if the action is a 'pull_request' and just in the 'main' branch. + branches: [main] +jobs: + build: + # We want to run this job on ubuntu. + runs-on: ubuntu-latest + strategy: + matrix: + java_version: [17] + steps: + # Do some checks for the repository. + - name: Checkout Repository + uses: actions/checkout@v2 + + # Validate the Gradle Wrapper. + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v1 + + # Setups the Java Version specified for this job. + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + # We use Java 8 for this. + java-version: ${{ matrix.java_version }} + # We use the Azul Zulu distribution for the JDK. + distribution: zulu + + # Performs the project build. + - name: Build plugin + # Give permissions to perform the script execution. + # And execute shadowJar script to compile project jars. + run: | + chmod +x gradlew + ./gradlew shadowJar + + - name: Cleanup Gradle Cache + # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. + # Restoring these files from a GitHub Actions cache might cause problems for future builds. + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties