From d03938eaf729bb8a30872f296fea0c592a469d68 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 26 May 2024 11:26:45 -0700 Subject: [PATCH] Fix actions build --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++-------- .gitmodules | 3 +++ ConcurrentUtil | 1 + build.gradle | 6 ++++- installConcurrentUtil.sh | 6 +++++ 5 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 .gitmodules create mode 160000 ConcurrentUtil create mode 100755 installConcurrentUtil.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d9a1358..6057f2d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,41 @@ -name: "build" - +name: Build on: push: branches: [ "**" ] tags-ignore: [ "**" ] pull_request: - jobs: - call-build: - uses: "jpenilla/actions/.github/workflows/shared-ci.yml@master" - with: - artifacts-path: 'build/libs/*.jar' - loom: true - jdk-version: 21 + build: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + steps: + - name: "checkout git repository" + uses: actions/checkout@v4 + - name: "validate gradle wrapper" + uses: gradle/actions/wrapper-validation@v3 + - name: "setup jdk" + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + - name: "setup gradle" + uses: gradle/actions/setup-gradle@v3 + # gradle-build-action doesn't support caching files in the project dir + - name: "cache project local caches" + uses: actions/cache@v4 + with: + path: | + .gradle/loom-cache + key: ${{ runner.os }}-project-local-gradle-caches-${{ hashFiles('**/libs.versions.toml', '**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-project-local-gradle-caches- + - name: "setup concurrentutil" + run: ./installConcurrentUtil.sh + - name: "execute gradle build" + run: ./gradlew build + - name: "upload artifacts" + uses: actions/upload-artifact@v4 + with: + name: artifacts + path: "build/libs/*.jar" diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..32ac5cda --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ConcurrentUtil"] + path = ConcurrentUtil + url = https://github.com/Spottedleaf/ConcurrentUtil.git diff --git a/ConcurrentUtil b/ConcurrentUtil new file mode 160000 index 00000000..6998499c --- /dev/null +++ b/ConcurrentUtil @@ -0,0 +1 @@ +Subproject commit 6998499cdbc9b278934c3c92e4714b35d215da1e diff --git a/build.gradle b/build.gradle index a3f2f57b..b7e4ec1a 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,11 @@ base { } repositories { - mavenLocal() + mavenLocal { + mavenContent { + includeModule("ca.spottedleaf", "concurrentutil") + } + } } dependencies { diff --git a/installConcurrentUtil.sh b/installConcurrentUtil.sh new file mode 100755 index 00000000..6f59f533 --- /dev/null +++ b/installConcurrentUtil.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -eou pipefail + +git submodule update --init --recursive +cd ConcurrentUtil +mvn install