forked from Slimefun/Slimefun4
-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java # src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunCommand.java # src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotFactory.java # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricOreGrinder.java # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java
- Loading branch information
Showing
719 changed files
with
21,603 additions
and
12,527 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,49 @@ | ||
#!/bin/bash | ||
|
||
echo "[pre-commit check]" | ||
|
||
if ! [ -x "$(command -v mvn)" ]; then | ||
echo -e 'Maven are not installed!' | ||
echo | ||
echo 'Please visit following site to download latest maven:' | ||
echo | ||
echo " https://maven.apache.org/download.cgi" | ||
echo | ||
echo 'If you are sure that you have installed maven,' | ||
echo 'Please check whether your environment variables is being set properly.' | ||
exit 1 | ||
fi | ||
|
||
spotless() { | ||
if [ ! -e "mvn" ]; then | ||
return 0 | ||
fi | ||
|
||
CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached | awk '$1 != "D" && $NF ~ /\.xml?$/ { print $NF }')" | ||
|
||
if [ -z "$CHANGED_FILES" ]; then | ||
echo "No staged files." | ||
return 0 | ||
fi | ||
|
||
echo '[pre-commit] Executing Maven spotlessCheck before commit' | ||
|
||
git stash --quiet --keep-index | ||
|
||
mvn -B spotless:check | ||
|
||
RESULT=$? | ||
|
||
git stash pop -q | ||
|
||
if [ "$RESULT" -ne "0" ]; then | ||
echo -e "spotlessCheck failed..." | ||
echo -e 'You can try "./mvn spotless:apply" to apply auto-fixes.' | ||
fi | ||
|
||
return $RESULT | ||
} | ||
|
||
if ! spotless; then | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Slimefun Build Test | ||
name: Slimefun Builder | ||
|
||
on: | ||
push: | ||
|
@@ -10,11 +10,6 @@ on: | |
paths: | ||
- 'src/**' | ||
- 'pom.xml' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/**' | ||
- 'src/**' | ||
- 'pom.xml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -28,21 +23,24 @@ jobs: | |
java-version: 17 | ||
java-package: jdk | ||
architecture: x64 | ||
- run: mvn -B test --file pom.xml --errors | ||
- name: Codestyle Check | ||
run: mvn -B spotless:check -s $GITHUB_WORKSPACE/settings.xml --file pom.xml --errors | ||
- name: Build Slimefun | ||
run: mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml --errors | ||
- uses: actions/cache@v2 | ||
if: github.event_name != 'pull_request' | ||
name: Cache dependencies | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- uses: actions/upload-artifact@v2 | ||
if: github.event_name != 'pull_request' | ||
name: Upload Beta artifact | ||
with: | ||
name: Slimefun.jar | ||
name: Slimefun Beta Build | ||
path: staging | ||
- name: Automatic Releases | ||
uses: marvinpinto/[email protected] | ||
if: github.event_name != 'pull_request' && github.ref_name == 'master' | ||
if: github.ref_name == 'master' | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "exp" | ||
|
108 changes: 54 additions & 54 deletions
108
.github/workflows/dev-release.yml → .github/workflows/dev-ci.yml
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 |
---|---|---|
@@ -1,54 +1,54 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Slimefun DEV | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'src/**' | ||
- 'pom.xml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
java-package: jdk | ||
architecture: x64 | ||
cache: maven | ||
server-id: github | ||
settings-path: ${{ github.workspace }} | ||
- name: Build Slimefun | ||
if: github.event_name != 'pull_request' | ||
run: mvn -B package --file pom.xml --errors | ||
- name: Publish Slimefun | ||
if: github.event_name != 'pull_request' | ||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file pom-github-package.xml --errors | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Mask Output | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
echo "::add-mask::$CF_API_TOKEN" | ||
env: | ||
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | ||
- name: Find build artifact filename | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
cd target && FILENAME=$(find . -maxdepth 1 -mindepth 1 -name "Slimefun-*" | cut -d'/' -f 2) | ||
echo "slimefun-artifact-name=$FILENAME" >> "$GITHUB_ENV" | ||
cd .. | ||
- name: Upload Build | ||
if: github.event_name != 'pull_request' | ||
uses: cloudflare/[email protected] | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
command: "r2 object put slimefun-dev/${{ env.slimefun-artifact-name }} --file=./target/${{ env.slimefun-artifact-name }} --content-type=application/java-archive" | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Slimefun DEV | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- 'src/**' | ||
- 'pom.xml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
java-package: jdk | ||
architecture: x64 | ||
cache: maven | ||
- name: Codestyle check | ||
run: mvn -B spotless:check --file pom.xml --errors | ||
- name: Build Slimefun | ||
run: mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml --errors | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Publish Slimefun | ||
run: mvn -B deploy --file pom.xml --errors | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Mask Output | ||
run: | | ||
echo "::add-mask::$CF_API_TOKEN" | ||
env: | ||
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | ||
- name: Get build artifact filename | ||
run: | | ||
cd target && FILENAME=$(find . -maxdepth 1 -mindepth 1 -name "slimefun-*" | cut -d'/' -f 2) | ||
echo "slimefun-artifact-name=$FILENAME" >> "$GITHUB_ENV" | ||
cd .. | ||
- name: Upload Build to R2 | ||
uses: cloudflare/[email protected] | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
command: "r2 object put slimefun-dev/${{ env.slimefun-artifact-name }} --file=./target/${{ env.slimefun-artifact-name }} --content-type=application/java-archive" |
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,16 @@ | ||
name: Package Maintainer | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 17 * * *' | ||
|
||
jobs: | ||
delete-package-versions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/delete-package-versions@v4 | ||
with: | ||
package-name: 'com.github.slimefun.slimefun' | ||
package-type: 'maven' | ||
min-versions-to-keep: 5 |
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,25 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Pull Request Checker | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/**' | ||
- 'src/**' | ||
- 'pom.xml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
java-package: jdk | ||
architecture: x64 | ||
- name: Codestyle Check | ||
run: mvn -B spotless:check build -s $GITHUB_WORKSPACE/settings.xml --file pom.xml --errors |
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
Oops, something went wrong.