diff --git a/.github/workflows/build-commit.yml b/.github/workflows/build-commit.yml new file mode 100644 index 0000000..ef4d30e --- /dev/null +++ b/.github/workflows/build-commit.yml @@ -0,0 +1,55 @@ +# Automatically build the project and run any configured tests for every push. +# This can help catch issues that only occur on +# certain platforms or Java versions, and provides a first line of defense +# against bad commits. + +name: build + +on: + push: + +jobs: + build: + runs-on: ubuntu-24.04 + + steps: + - name: Extract current branch name + shell: bash + run: | + ref="${GITHUB_REF#refs/heads/}" + echo "branch=${ref////-}" >> $GITHUB_OUTPUT + id: ref + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'microsoft' + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build + run: ./gradlew build + + - name: Rename JAR for distribution + run: | + MAIN_JAR=$(ls build/libs/*.jar | grep -v 'sources' | head -n 1) + SOURCES_JAR=$(ls build/libs/*sources*.jar | head -n 1) + + VERSION=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2) + MC_VERSION=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2) + + BASE="bbe-${VERSION}+${MC_VERSION}-build.${{ github.run_number }}" + + mv "$MAIN_JAR" "build/libs/${BASE}.jar" + mv "$SOURCES_JAR" "build/libs/${BASE}-sources.jar" + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: bbe-artifacts-${{ github.run_number }} + path: build/libs/*.jar diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml new file mode 100644 index 0000000..328b7f8 --- /dev/null +++ b/.github/workflows/build-pull-request.yml @@ -0,0 +1,50 @@ +# Used when building external pull requests +# We don't want to publish build artifacts or expose our other caches to possibly untrusted code +name: build-pull-request + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Setup Gradle (read-only cache) + uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true + + - name: Build + run: ./gradlew build + + - name: Rename JAR for distribution + run: | + MAIN_JAR=$(ls build/libs/*.jar | grep -v 'sources' | head -n 1) + SOURCES_JAR=$(ls build/libs/*sources*.jar | head -n 1) + + VERSION=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2) + MC_VERSION=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2) + + BASE="bbe-${VERSION}+${MC_VERSION}-build.${{ github.run_number }}" + + mv "$MAIN_JAR" "build/libs/${BASE}.jar" + mv "$SOURCES_JAR" "build/libs/${BASE}-sources.jar" + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: bbe-artifacts-${{ github.run_number }} + path: build/libs/*.jar diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-tag.yml new file mode 100644 index 0000000..7a843c2 --- /dev/null +++ b/.github/workflows/build-tag.yml @@ -0,0 +1,38 @@ +# Used when a commit is tagged and pushed to the repository +# This makes use of caching for faster builds and uploads the resulting artifacts +name: build-tag + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Extract current branch name + shell: bash + # bash pattern expansion to grab branch name without slashes + run: ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT + id: ref + - name: Checkout sources + uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: Execute Gradle build + run: ./gradlew build -Pbuild.release=true + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: bbe-artifacts-${{ steps.ref.outputs.branch }} + path: build/libs/*.jar diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 8fc3827..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. - -name: build -on: [pull_request, push] - -jobs: - build: - runs-on: ubuntu-24.04 - steps: - - name: checkout repository - uses: actions/checkout@v4 - - name: validate gradle wrapper - uses: gradle/actions/wrapper-validation@v4 - - name: setup jdk - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'microsoft' - - name: make gradle wrapper executable - run: chmod +x ./gradlew - - name: build - run: ./gradlew build - - name: capture build artifacts - uses: actions/upload-artifact@v4 - with: - name: Artifacts - path: build/libs/ \ No newline at end of file diff --git a/README.md b/README.md index 90b33de..9edabe4 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,6 @@ A- Minecraft versions from 1.21.6 and above **Q- Are backports planned?** A- No backports are planned -**Q- I don't see my sherds/pottery pattern on my Decorated Pot** -A- We have yet to implement this into the mod, but support for this will come in a future update! If you want your pottery patterns to work, disable the decorated pot in the config screen. - **Q- My chests (or any other block entity) is invisible/glitched, what do I do?** A- You are most likely using a resource pack that conflicts with BBE, either disable the block entity optimizations through the config screen or turn off the resource pack. diff --git a/gradle.properties b/gradle.properties index 3d5404d..60336c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.17.3 loom_version=1.11-SNAPSHOT # mod properties -mod_version=1.2.0 +mod_version=1.3.0+1.21.10 maven_group=ceeden archives_base_name=bbe