Skip to content

Commit a3fba96

Browse files
committed
first commit
0 parents  commit a3fba96

9 files changed

Lines changed: 740 additions & 0 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build and Release Plugins
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: temurin
24+
java-version: "17"
25+
cache: maven
26+
27+
- name: Build all Maven plugins
28+
shell: bash
29+
run: |
30+
set -euo pipefail
31+
shopt -s nullglob
32+
33+
found=0
34+
while IFS= read -r pom; do
35+
found=1
36+
plugin_dir="$(dirname "$pom")"
37+
echo "Building $plugin_dir"
38+
mvn -B -f "$pom" clean package
39+
done < <(find . -mindepth 2 -maxdepth 3 -name pom.xml | sort)
40+
41+
if [[ "$found" -eq 0 ]]; then
42+
echo "No plugin pom.xml files found."
43+
exit 1
44+
fi
45+
46+
- name: Collect JAR artifacts
47+
id: collect
48+
shell: bash
49+
run: |
50+
set -euo pipefail
51+
shopt -s nullglob
52+
53+
mkdir -p release-assets
54+
mapfile -t jars < <(
55+
find . -type f -path "*/target/*.jar" \
56+
! -name "*-sources.jar" \
57+
! -name "*-javadoc.jar" \
58+
! -name "original-*.jar" \
59+
| sort
60+
)
61+
62+
if [[ "${#jars[@]}" -eq 0 ]]; then
63+
echo "No JAR files found after build."
64+
exit 1
65+
fi
66+
67+
for jar in "${jars[@]}"; do
68+
plugin_name="$(basename "$(dirname "$(dirname "$jar")")")"
69+
jar_name="$(basename "$jar")"
70+
cp "$jar" "release-assets/${plugin_name}-${jar_name}"
71+
done
72+
73+
echo "Collected assets:"
74+
ls -1 release-assets
75+
76+
- name: Create GitHub release and upload JARs
77+
uses: softprops/action-gh-release@v2
78+
with:
79+
tag_name: main-${{ github.sha }}
80+
name: Main build ${{ github.sha }}
81+
generate_release_notes: true
82+
prerelease: true
83+
files: release-assets/*.jar

‎.gitignore‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Maven
2+
target/
3+
pom.xml.tag
4+
pom.xml.releaseBackup
5+
pom.xml.versionsBackup
6+
pom.xml.next
7+
release.properties
8+
dependency-reduced-pom.xml
9+
buildNumber.properties
10+
.mvn/timing.properties
11+
.mvn/wrapper/maven-wrapper.jar
12+
13+
# Gradle (if added later)
14+
.gradle/
15+
build/
16+
!gradle/wrapper/gradle-wrapper.jar
17+
18+
# Java
19+
*.class
20+
*.jar
21+
*.war
22+
*.ear
23+
hs_err_pid*
24+
replay_pid*
25+
26+
# IDE — IntelliJ / Android Studio
27+
.idea/
28+
*.iml
29+
*.ipr
30+
*.iws
31+
out/
32+
33+
# IDE — Eclipse
34+
.classpath
35+
.project
36+
.settings/
37+
bin/
38+
39+
# IDE — VS Code (local overrides; uncomment if you never commit workspace settings)
40+
# .vscode/
41+
42+
# OS
43+
.DS_Store
44+
Thumbs.db
45+
46+
# Logs and temp
47+
*.log
48+
*.tmp
49+
*.swp
50+
*~

‎SpearUpgradesCow/README.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SpearUpgradesCow
2+
3+
Spigot/Paper plugin: players get a custom spear that upgrades each time they kill a cow with it. Tiers, lunge, Sharpness, and bonus damage are configured in `src/main/resources/config.yml`.
4+
5+
## Requirements
6+
7+
- **Java 17** (matches `pom.xml`)
8+
- **Apache Maven** 3.x
9+
10+
## Build the plugin JAR
11+
12+
From this directory (`SpearUpgradesCow`):
13+
14+
```bash
15+
mvn clean package
16+
```
17+
18+
The plugin jar is written to:
19+
20+
`target/SpearUpgradesCow-1.0.0.jar`
21+
22+
Copy that file into your server’s `plugins` folder and restart (or load the plugin with your server’s plugin manager).

‎SpearUpgradesCow/pom.xml‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.johnfmarion</groupId>
8+
<artifactId>SpearUpgradesCow</artifactId>
9+
<version>1.0.0</version>
10+
<packaging>jar</packaging>
11+
12+
<name>SpearUpgradesCow</name>
13+
<description>Upgrade spears by killing cows</description>
14+
15+
<properties>
16+
<java.version>17</java.version>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
20+
<build>
21+
<defaultGoal>clean package</defaultGoal>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.11.0</version>
27+
<configuration>
28+
<source>${java.version}</source>
29+
<target>${java.version}</target>
30+
</configuration>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-shade-plugin</artifactId>
35+
<version>3.5.0</version>
36+
<executions>
37+
<execution>
38+
<phase>package</phase>
39+
<goals>
40+
<goal>shade</goal>
41+
</goals>
42+
<configuration>
43+
<createDependencyReducedPom>false</createDependencyReducedPom>
44+
</configuration>
45+
</execution>
46+
</executions>
47+
</plugin>
48+
</plugins>
49+
<resources>
50+
<resource>
51+
<directory>src/main/resources</directory>
52+
<filtering>true</filtering>
53+
</resource>
54+
</resources>
55+
</build>
56+
57+
<repositories>
58+
<repository>
59+
<id>spigotmc-repo</id>
60+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
61+
</repository>
62+
<repository>
63+
<id>sonatype</id>
64+
<url>https://oss.sonatype.org/content/groups/public/</url>
65+
</repository>
66+
</repositories>
67+
68+
<dependencies>
69+
<dependency>
70+
<groupId>org.spigotmc</groupId>
71+
<artifactId>spigot-api</artifactId>
72+
<version>1.20.1-R0.1-SNAPSHOT</version>
73+
<scope>provided</scope>
74+
</dependency>
75+
</dependencies>
76+
</project>

0 commit comments

Comments
 (0)