Skip to content

Commit

Permalink
Merge branch 'master' into feature/unlock-items-in-recipe-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
J3fftw1 authored Dec 5, 2023
2 parents e572df0 + 5f9da5b commit 5697404
Show file tree
Hide file tree
Showing 123 changed files with 2,519 additions and 748 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Automatically normalize line endings (to LF) for all text-based files.
* text=auto eol=lf
4 changes: 2 additions & 2 deletions .github/workflows/discord-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.1

- name: Set up Java JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: End to End Testing

on:
workflow_call:
inputs:
artifact-name:
description: 'Slimefun artifact name'
required: true
type: string

jobs:
e2e-testing:
name: End to End Testing
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
matrix:
include:
- mcVersion: '1.16.5'
javaVersion: '16'
- mcVersion: '1.17.1'
javaVersion: '17'
- mcVersion: '1.18.2'
javaVersion: '18'
- mcVersion: '1.19.4'
javaVersion: '19'
- mcVersion: '1.20.1'
javaVersion: '20'

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/[email protected]
with:
distribution: temurin
java-version: ${{ matrix.javaVersion }}
java-package: jdk
architecture: x64

- name: Setup server
run: |
echo 'eula=true' > eula.txt
mkdir plugins
- name: Download ${{ matrix.mcVersion }} Paper
run: |
VERSION="${{ matrix.mcVersion }}"
BUILD_JAR=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds" \
| jq '.builds[-1] | "\(.build) \(.downloads.application.name)"' -r)
BUILD=$(echo "$BUILD_JAR" | awk '{print $1}')
JAR_FILE=$(echo "$BUILD_JAR" | awk '{print $2}')
curl -o paper.jar \
"https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE"
- name: Download Slimefun
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact-name }}
path: plugins/

- name: Download e2e-tester
run: |
curl -o e2e-tester.jar https://preview-builds.walshy.dev/download/e2e-tester/main/latest
mv e2e-tester.jar plugins/e2e-tester.jar
- name: Run server
run: |
java -jar paper.jar --nogui
2 changes: 1 addition & 1 deletion .github/workflows/json-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate wiki.json
uses: docker://orrosenblatt/validate-json-action:latest@sha256:02370758b8b199e0477da11ecfdd498c75c561685056b5c31b925a4ab95df7f4
env:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/maven-compiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: 'adopt'
java-version: '17'
Expand All @@ -44,9 +44,3 @@ jobs:

- name: Build with Maven
run: mvn package --file pom.xml

- name: Upload the artifact
uses: actions/upload-artifact@v3
with:
name: slimefun-${{ github.event.number }}
path: 'target/Slimefun v4.9-UNOFFICIAL.jar'
2 changes: 1 addition & 1 deletion .github/workflows/merge-conflicts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
validate:

if: github.repository == 'Slimefun/Slimefun4'
name: Check for merge conflicts
runs-on: ubuntu-latest

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
api: '🔧 API'
compatibility: '🤝 Compatibility'

- uses: thollander/[email protected].0
- uses: thollander/[email protected].3
name: Leave a comment about the applied label
if: ${{ steps.labeller.outputs.applied != 0 }}
with:
Expand All @@ -40,7 +40,7 @@ jobs:
Your Pull Request was automatically labelled as: "${{ steps.labeller.outputs.applied }}"
Thank you for contributing to this project! ❤️
- uses: thollander/[email protected].0
- uses: thollander/[email protected].3
name: Leave a comment about our branch naming convention
if: ${{ steps.labeller.outputs.applied == 0 }}
with:
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/preview-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Preview builds

on:
workflow_run:
workflows: ["Java CI"]
workflows: ["Pull Request"]
types:
- completed

Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
# Kinda jank way to grab the PR and run ID and then download the artifact
# Kinda jank way to grab the PR and commit hash and then download the artifact
# TODO: Move this code to our own mini-action
- name: Grab PR & run ID and download the artifact
uses: actions/github-script@v6
Expand All @@ -30,13 +30,13 @@ jobs:
});
for (const artifact of allArtifacts.data.artifacts) {
// Extract the PR number from the artifact name
const match = /^slimefun-(\d+)$/.exec(artifact.name);
// Extract the PR number and commit hash from the artifact name
const match = /^slimefun-(\d+)-([a-f0-9]{8})$/.exec(artifact.name);
if (match) {
require("fs").appendFileSync(
process.env.GITHUB_ENV,
`\nWORKFLOW_PR_ID=${match[1]}` +
`\nWORKFLOW_RUN_ID=${context.payload.workflow_run.id}`
`\nPR_NUMBER=${match[1]}` +
`\nCOMMIT_HASH=${match[2]}`
);
const download = await github.rest.actions.downloadArtifact({
Expand All @@ -56,26 +56,27 @@ jobs:
run: |
unzip preview.zip
rm preview.zip
mv 'Slimefun v4.9-UNOFFICIAL.jar' preview.jar
mv 'Slimefun vPreview Build #${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}.jar' preview.jar
- name: Upload to preview service
run: |
curl -v -X POST \
curl -X POST \
-H 'Authorization: ${{ secrets.PUBLISH_TOKEN }}' \
-H "X-Checksum: $(sha256sum 'preview.jar' | awk '{print $1}')" \
--data-binary '@preview.jar' \
https://preview-builds.walshy.dev/upload/Slimefun/${{ env.WORKFLOW_PR_ID }}/${{ env.WORKFLOW_RUN_ID }}
https://preview-builds.walshy.dev/upload/Slimefun/${{ env.PR_NUMBER }}/${{ env.COMMIT_HASH }}
- name: Post comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ env.WORKFLOW_PR_ID }}
number: ${{ env.PR_NUMBER }}
message: |
### Slimefun preview build
A Slimefun preview build is available for testing!
Commit: ${{ env.COMMIT_HASH }}
https://preview-builds.walshy.dev/download/Slimefun/${{ env.WORKFLOW_PR_ID }}/${{ env.WORKFLOW_RUN_ID }}
https://preview-builds.walshy.dev/download/Slimefun/${{ env.PR_NUMBER }}/${{ env.COMMIT_HASH }}
> **Note**: This is not a supported build and is only here for the purposes of testing.
> Do not run this on a live server and do not report bugs anywhere but this PR!
62 changes: 62 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Pull Request

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'pom.xml'

permissions:
contents: read

jobs:
setup-preview-build:
name: Preview build
runs-on: ubuntu-latest
outputs:
short-commit-hash: ${{ steps.env-setup.outputs.SHORT_COMMIT_HASH }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '17'
java-package: jdk
architecture: x64

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

# Setup for the preview build
- id: env-setup
run: |
SHORT_COMMIT_HASH=$(git rev-parse --short=8 ${{ github.sha }})
JAR_VERSION="Preview Build #${{ github.event.number }}-$SHORT_COMMIT_HASH"
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_ENV"
echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_OUTPUT"
echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV"
sed -i "s/<version>4.9-UNOFFICIAL<\/version>/<version>$JAR_VERSION<\/version>/g" pom.xml
- name: Build with Maven
run: mvn package

- name: Upload the artifact
uses: actions/upload-artifact@v3
with:
name: slimefun-${{ github.event.number }}-${{ env.SHORT_COMMIT_HASH }}
path: 'target/Slimefun v${{ env.JAR_VERSION }}.jar'

call-workflows:
needs: [setup-preview-build]
uses: ./.github/workflows/e2e-testing.yml
with:
artifact-name: slimefun-${{ github.event.number }}-${{ needs.setup-preview-build.outputs.short-commit-hash }}
2 changes: 1 addition & 1 deletion .github/workflows/release-candidates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'stable'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v3.13.0
with:
distribution: 'adopt'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: YAML Linter
uses: ibiqlik/[email protected]
with:
Expand Down
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Table of contents
- [Release Candidate 35 (TBD)](#release-candidate-35-tbd)
- [Release Candidate 36 (TBD)](#release-candidate-36-tbd)
- [Release Candidate 35 (7 Jul 2023)](#release-candidate-35-7-jul-2023)
- [Release Candidate 34 (20 Jun 2023)](#release-candidate-34-20-jun-2023)
- [Release Candidate 33 (07 Jan 2023)](#release-candidate-33-07-jan-2023)
- [Release Candidate 32 (26 Jun 2022)](#release-candidate-32-26-jun-2022)
Expand Down Expand Up @@ -35,15 +36,30 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## Release Candidate 35 (TBD)
## Release Candidate 36 (TBD)

#### Additions

#### Changes

#### Fixes

## Release Candidate 35 (7 Jul 2023)

#### Additions
* Added `sounds.yml` file to configure sound effects for Slimefun
* Added preview builds to the repo, PRs will now have a build which testers can use
* (API) Added SlimefunBlockBreakEvent and SlimefunBlockPlaceEvent events for plugins/addons to implement
* (API) Added an efficient way to clear BlockStorage within a chunk - BlockStorage.clearAllBlockInfoAtChunk
* (API) Added DistinctiveItem, a way to distinguish your item with more than just ID
* (API) Added ExternallyInteractable, a way for addons to define "interactions" for blocks

#### Changes
* Moved all sound effects to the new sound system

#### Fixes
* Fixed recipe shift in multiblocks when items are disabled (#3286)
* Fixed backpack dupe within cargo (#3379)

## Release Candidate 34 (20 Jun 2023)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#34
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is a full summary of the differences between the two different versions of

| | development (latest) | "stable" |
| ------------------ | -------- | -------- |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.20.\*** | :video_game: **1.14.\* - 1.20.\*** |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.20.\*** | :video_game: **1.16.\* - 1.20.\*** |
| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 16 (or higher)** |
| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: |
| **frequent updates** | :heavy_check_mark: | :x: |
Expand Down
Loading

0 comments on commit 5697404

Please sign in to comment.