Skip to content

Commit

Permalink
Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphJACK committed Jul 6, 2024
1 parent 4623c28 commit 1407893
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Archive

on:
push:
branches:
- 1.20.x
pull_request:
branches:
- 1.20.x

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [1.20.x]

steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'

- name: Cache Gradle files
uses: actions/cache@v3
with:
path: |
~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache Gradle build directory
uses: actions/cache@v3
with:
path: build
key: ${{ runner.os }}-gradle-build-${{ hashFiles('build.gradle', 'settings.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-build-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean build

- name: Archive JAR file
if: success()
uses: actions/upload-artifact@v3
with:
name: build-artifact-${{ matrix.branch }}
path: build/libs/*.jar

0 comments on commit 1407893

Please sign in to comment.