Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Oribuin committed Sep 7, 2024
2 parents 18ed38d + f1363ce commit 949beee
Show file tree
Hide file tree
Showing 313 changed files with 7,861 additions and 1,974 deletions.
1 change: 1 addition & 0 deletions .adr-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/adr
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
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ body:
options:
- label: I am using the official english version of Slimefun and did not modify the jar.
required: true
- label: I downloaded the official version from the new build site [Blob Builds](https://blob.build/).
required: true
- label: I am using an up to date "DEV" (not "RC") version of Slimefun.
required: true
- label: I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
Expand Down Expand Up @@ -113,12 +115,11 @@ body:
label: '🎮 Minecraft Version'
description: 'Please select the Minecraft version of the server'
options:
- 1.20.x
- 1.19.x
- 1.18.x
- 1.17.x
- 1.16.x
- 1.15.x
- 1.14.x
- (Older versions are not supported)

- id: slimefun-version
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- Don't worry, these are not requirements. They only serve as guidance. -->
- [ ] I have fully tested the proposed changes and promise that they will not break everything into chaos.
- [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
- [ ] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.14.* - 1.19.*).
- [ ] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.20.*).
- [ ] I followed the existing code standards and didn't mess up the formatting.
- [ ] I did my best to add documentation to any public classes or methods I added.
- [ ] I have added `Nonnull` and `Nullable` annotations to my methods to indicate their behaviour for null values
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Approve via actions
uses: hmarr/auto-approve-action@v3.1.0
uses: hmarr/auto-approve-action@v4.0.0
if: github.actor == 'TheBusyBot' || github.actor == 'renovate[bot]'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
4 changes: 2 additions & 2 deletions .github/workflows/auto-squash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Auto squash
uses: pascalgn/automerge-action@v0.15.5
uses: pascalgn/automerge-action@v0.16.2
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
UPDATE_RETRIES: 0
Expand All @@ -42,7 +42,7 @@ jobs:

steps:
- name: Auto squash
uses: pascalgn/automerge-action@v0.15.5
uses: pascalgn/automerge-action@v0.16.2
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
UPDATE_RETRIES: 0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/discord-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:

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

- name: Set up Java JDK 17
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
java-package: jdk
architecture: x64

- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: 'latest'
javaVersion: '20'

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

- 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 }}"
if [ "$VERSION" == "latest" ]; then
VERSION=$(curl https://api.papermc.io/v2/projects/paper/ -s | jq -r '.versions[-1]')
fi
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}')
echo "Downloading... https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE"
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@v4
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
37 changes: 37 additions & 0 deletions .github/workflows/javadocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Javadocs

on:
push:
paths:
- 'src/**'
- 'pom.xml'

permissions:
contents: read

jobs:
build:
name: Maven build
runs-on: ubuntu-latest

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@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build Javadocs
run: mvn javadoc:javadoc
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
7 changes: 4 additions & 3 deletions .github/workflows/maven-compiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/**'
- 'src/**'
- 'pom.xml'
- 'CHANGELOG.md'

permissions:
contents: read
Expand All @@ -24,18 +25,18 @@ jobs:

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

- name: Set up JDK 17
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v4.0.0
with:
distribution: 'adopt'
java-version: '17'
java-package: jdk
architecture: x64

- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
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
6 changes: 3 additions & 3 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pull Request Labels

on:
pull_request:
pull_request_target:
types:
- opened

Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
api: '🔧 API'
compatibility: '🤝 Compatibility'

- uses: thollander/actions-comment-pull-request@v1.5.0
- uses: thollander/actions-comment-pull-request@v2.5.0
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/actions-comment-pull-request@v1.5.0
- uses: thollander/actions-comment-pull-request@v2.5.0
name: Leave a comment about our branch naming convention
if: ${{ steps.labeller.outputs.applied == 0 }}
with:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/preview-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Preview builds

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

permissions:
contents: read
pull-requests: write

jobs:
preview:
if: ${{ github.repository_owner == 'Slimefun' && github.event.workflow_run.conclusion == 'success' }}
name: Build and Publish the jar
runs-on: ubuntu-latest

steps:
# 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@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
for (const artifact of allArtifacts.data.artifacts) {
// 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,
`\nPR_NUMBER=${match[1]}` +
`\nCOMMIT_HASH=${match[2]}`
);
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
require('fs').writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview.zip`, Buffer.from(download.data))
break;
}
}
# Unzip the artifact
- name: Unzip
run: |
unzip preview.zip
rm preview.zip
mv 'Slimefun vPreview Build #${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}.jar' preview.jar
- name: Upload to preview service
run: |
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.PR_NUMBER }}/${{ env.COMMIT_HASH }}
- name: Post comment
uses: marocchino/sticky-pull-request-comment@v2
with:
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.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!
36 changes: 36 additions & 0 deletions .github/workflows/publish-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish build

on:
push:
branches:
- master
- stable

jobs:
publish:
name: Upload build
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[ci skip]') == false

steps:
- 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: Build with Maven
run: mvn clean package

- name: Upload to Blob Builds
uses: WalshyDev/blob-builds/gh-action@f3da5ce7b7e2b70eb963e0c0014677b3d78c10fa
with:
project: Slimefun4
releaseChannel: ${{ github.ref == 'refs/heads/master' && 'Dev' || 'RC' }}
apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }}
file: './target/Slimefun v4.9-UNOFFICIAL.jar'
releaseNotes: ${{ github.event.head_commit.message }}
Loading

0 comments on commit 949beee

Please sign in to comment.