Skip to content

Commit b658c3a

Browse files
cryptobenchclaude
andcommitted
Add GitHub Actions for automated builds and releases
- Build workflow triggers on push/PR to master/main - Release workflow creates GitHub release on version tags (v*) - Requires HytaleServer.jar via HYTALE_SERVER_URL variable or lib/ folder - Updated pom.xml with configurable hytale.server.path property To create a release: git tag v1.0.0 git push origin v1.0.0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ccc2ff1 commit b658c3a

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

.github/workflows/build.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [ master, main ]
10+
workflow_dispatch: # Allow manual trigger
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Java 25
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '25-ea'
24+
distribution: 'temurin'
25+
cache: maven
26+
27+
- name: Create lib directory
28+
run: mkdir -p lib
29+
30+
- name: Download HytaleServer.jar from secret URL
31+
if: ${{ vars.HYTALE_SERVER_URL != '' }}
32+
run: curl -L -o lib/HytaleServer.jar "${{ vars.HYTALE_SERVER_URL }}"
33+
34+
- name: Check for HytaleServer.jar in lib folder
35+
run: |
36+
if [ ! -f lib/HytaleServer.jar ]; then
37+
echo "ERROR: HytaleServer.jar not found!"
38+
echo ""
39+
echo "To fix this, do ONE of the following:"
40+
echo "1. Add a repository variable HYTALE_SERVER_URL with a download link"
41+
echo "2. Add lib/HytaleServer.jar to the repository"
42+
echo ""
43+
exit 1
44+
fi
45+
echo "Found HytaleServer.jar"
46+
47+
- name: Build with Maven
48+
run: mvn clean package -Dhytale.server.path=${{ github.workspace }}/lib/HytaleServer.jar
49+
50+
- name: Upload artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: HomeEssentials
54+
path: target/HomeEssentials-*.jar
55+
56+
release:
57+
needs: build
58+
runs-on: ubuntu-latest
59+
if: startsWith(github.ref, 'refs/tags/v')
60+
permissions:
61+
contents: write
62+
63+
steps:
64+
- name: Download artifact
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: HomeEssentials
68+
path: ./dist
69+
70+
- name: Get version from tag
71+
id: version
72+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
73+
74+
- name: Rename JAR to include version
75+
run: |
76+
cd dist
77+
mv HomeEssentials-*.jar HomeEssentials-${{ steps.version.outputs.VERSION }}.jar
78+
79+
- name: Create Release
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
name: HomeEssentials v${{ steps.version.outputs.VERSION }}
83+
body: |
84+
## HomeEssentials v${{ steps.version.outputs.VERSION }}
85+
86+
A home management plugin for Hytale servers.
87+
88+
### Installation
89+
1. Download `HomeEssentials-${{ steps.version.outputs.VERSION }}.jar` below
90+
2. Place in your Hytale server's `mods/` folder
91+
3. Restart the server
92+
93+
### Quick Setup
94+
Run in server console:
95+
```
96+
perm group add default homes.use
97+
perm group add default homes.limit.1
98+
```
99+
100+
### Commands
101+
| Command | Description |
102+
|---------|-------------|
103+
| `/sethome [name]` | Save your location |
104+
| `/home [name]` | Teleport to home |
105+
| `/homes` | List all homes |
106+
| `/delhome <name>` | Delete a home |
107+
| `/homehelp` | Show full help |
108+
109+
### Permissions
110+
| Permission | Description |
111+
|------------|-------------|
112+
| `homes.use` | Basic access |
113+
| `homes.limit.1` | 1 home (default) |
114+
| `homes.limit.3` | 3 homes |
115+
| `homes.limit.5` | 5 homes |
116+
| `homes.limit.unlimited` | Unlimited |
117+
files: ./dist/HomeEssentials-${{ steps.version.outputs.VERSION }}.jar
118+
draft: false
119+
prerelease: false

pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<maven.compiler.source>25</maven.compiler.source>
1717
<maven.compiler.target>25</maven.compiler.target>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<!-- Override this for CI builds: -Dhytale.server.path=/path/to/HytaleServer.jar -->
20+
<hytale.server.path>${project.basedir}/../../HytaleServer.jar</hytale.server.path>
1921
</properties>
2022

2123
<dependencies>
@@ -25,10 +27,10 @@
2527
<artifactId>HytaleServer</artifactId>
2628
<version>1.0.0</version>
2729
<scope>system</scope>
28-
<systemPath>${project.basedir}/../../HytaleServer.jar</systemPath>
30+
<systemPath>${hytale.server.path}</systemPath>
2931
</dependency>
3032

31-
<!-- JSON processing - Gson is likely already in Hytale, mark as provided -->
33+
<!-- JSON processing - Gson is provided by Hytale -->
3234
<dependency>
3335
<groupId>com.google.code.gson</groupId>
3436
<artifactId>gson</artifactId>

0 commit comments

Comments
 (0)