Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
+ Updated version to be proper semver (also bumped version)
+ Updated Spigot API to 1.16.5
+ Added `NBTAPI` as a dependency
+ Added Ant maven plugin with an execution to copy jar to development server
+  Rewrote most of the classes to not be shitty spaghetti code
+ Added Sounds to application success and failure
+ Updated config strings
  • Loading branch information
Puyodead1 committed Jun 20, 2021
1 parent da93c65 commit 0601f1c
Show file tree
Hide file tree
Showing 13 changed files with 548 additions and 300 deletions.
51 changes: 51 additions & 0 deletions .github/release-helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Ensure that the GITHUB_TOKEN secret is included
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN env variable."
exit 1
fi

# Prepare the headers for our curl-command.
AUTH_HEADER="Authorization: Token ${GITHUB_TOKEN}"

REQUEST_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}"
echo "Request URL is ${REQUEST_URL}"

# Generate a temporary file.
tmp=$(mktemp)

# Request - capturing HTTP response-code in our output file.
response=$(curl \
-sSL \
-H "${AUTH_HEADER}" \
--write-out "%{http_code}" \
--output $tmp \
"${REQUEST_URL}")

# If the curl-command returned a non-zero response we must abort
if [ "$?" -ne 0 ]; then
echo "**********************************"
echo " curl command did not return zero."
echo " Aborting"
echo "**********************************"
cat $tmp
rm $tmp
exit 1
fi

# If request is not successful, we must abort
if [ $response -ge 400 ]; then
echo "***************************"
echo " request failed."
echo " Aborting"
echo " HTTP status is $response"
echo "**********************************"
cat $tmp
rm $tmp
exit 1
fi

# Show pretty output, since we already have jq
echo ::set-output name=COMMIT_MESSAGE::`cat $tmp | jq .commit.message`
rm $tmp
49 changes: 49 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
release:
types:
- created

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: '8.0.292+1'

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

- name: Run Helper
id: helper
run: "chmod +x ./.github/release-helper && bash ./.github/release-helper"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
- name: Make Artifact Directory
run: "mkdir ./artifacts"

- name: Find and Move JARS
run: "mv `find ./target -name ChunkSpawnerLimiter-*.jar -print` ./artifacts"

- name: Upload to release
uses: Puyodead1/upload-to-release@master
with:
args: './artifacts/ChunkSpawnerLimiter-*.jar'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - id: set_json
# run: echo "::set-output name=json::[{\"title\":\"New Release!\",\"url\":\"${{ steps.create_release.outputs.url }}\",\"description\":\"A new release has been published for ${{ github.repository }}\",\"color\":3329330,\"timestamp\":\"2021-06-15T00:22:23.172Z\",\"author\":{\"name\":\"${{ github.repository }}\"},\"fields\":[{\"name\":\"Build\",\"value\":\"${{ github.run_id }}\"},{\"name\":\"Changes\",\"value\":\"${{ steps.helper.outputs.COMMIT_MESSAGE }}\"}]}]"
# - name: Discord Release Message
# if: success()
# uses: Ilshidur/action-discord@master
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
# DISCORD_EMBEDS: ${{ steps.set_json.outputs.json }}
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: '8.0.292+1'

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

# - name: Run Helper
# id: helper
# run: "chmod +x ./.github/release-helper && bash ./.github/release-helper"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Make Artifact Directory
# run: "mkdir ./artifacts"
#
# - name: Find and Move JARS
# run: "mv `find . -name ChunkSpawnerLimiter-*.jar -print` ./artifacts"
#
# - name: Upload Artifact
# if: success()
# uses: actions/upload-artifact@master
# with:
# name: Artifacts
# path: "./artifacts"
107 changes: 80 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.puyodead</groupId>
<artifactId>EnchantCrystals</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.0.4-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>EnchantCrystals</name>
Expand All @@ -16,6 +16,60 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<!-- CodeMC -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<layout>default</layout>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>21.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-data-api</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-injector</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<type>maven-plugin</type>
</dependency>
</dependencies>

<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
Expand All @@ -34,16 +88,41 @@
<version>3.1.0</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>de.tr7zw.nbtapi</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy file="target/${project.name}-${project.version}.jar"
toFile="C:\Users\23562\Desktop\Plugin Test Server\1.17\plugins\${project.name}-${project.version}.jar"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand All @@ -52,30 +131,4 @@
</resource>
</resources>
</build>

<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 0601f1c

Please sign in to comment.