From 8cb395d73a74c3f563e01ad7734118127370777d Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 15 Mar 2025 12:53:27 +0100 Subject: [PATCH] ci: Add GitHub Actions workflow for building plugins --- .github/workflows/build.yml | 142 ++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..8c9515ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,142 @@ +name: Build Plugins + +on: + push: + pull_request: + types: + - opened +jobs: + build-fancyholograms: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: ~/.gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '21' + + - name: Modify gradlew permissions + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew :plugins:fancyholograms:shadowJar + + build-common: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: ~/.gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '21' + + - name: Modify gradlew permissions + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew :libraries:common:shadowJar + + build-jdb: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: ~/.gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '21' + + - name: Modify gradlew permissions + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew :libraries:jdb:shadowJar + + build-plugin-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: ~/.gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '21' + + - name: Modify gradlew permissions + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew :libraries:plugin-tests:shadowJar + + build-packets: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Cache Gradle dependencies + uses: actions/cache@v4 + with: + path: ~/.gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '21' + + - name: Modify gradlew permissions + run: chmod +x ./gradlew + + - name: Build plugin + run: ./gradlew :libraries:packets:shadowJar \ No newline at end of file