-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create workflow for future push or pull-request actions
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |