forked from Slimefun/Slimefun4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
313 changed files
with
7,861 additions
and
1,974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docs/adr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.