Skip to content

Commit

Permalink
feat: create workflow for future push or pull-request actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aivruu authored Jan 28, 2024
1 parent 2a4a903 commit 2294bb2
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
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

0 comments on commit 2294bb2

Please sign in to comment.