Skip to content

Add GitHub Actions for automated builds and releases #1

Add GitHub Actions for automated builds and releases

Add GitHub Actions for automated builds and releases #1

Workflow file for this run

name: Build and Release
on:
push:
branches: [ master, main ]
tags:
- 'v*'
pull_request:
branches: [ master, main ]
workflow_dispatch: # Allow manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: '25-ea'
distribution: 'temurin'
cache: maven
- name: Create lib directory
run: mkdir -p lib
- name: Download HytaleServer.jar from secret URL
if: ${{ vars.HYTALE_SERVER_URL != '' }}
run: curl -L -o lib/HytaleServer.jar "${{ vars.HYTALE_SERVER_URL }}"
- name: Check for HytaleServer.jar in lib folder
run: |
if [ ! -f lib/HytaleServer.jar ]; then
echo "ERROR: HytaleServer.jar not found!"
echo ""
echo "To fix this, do ONE of the following:"
echo "1. Add a repository variable HYTALE_SERVER_URL with a download link"
echo "2. Add lib/HytaleServer.jar to the repository"
echo ""
exit 1
fi
echo "Found HytaleServer.jar"
- name: Build with Maven
run: mvn clean package -Dhytale.server.path=${{ github.workspace }}/lib/HytaleServer.jar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: HomeEssentials
path: target/HomeEssentials-*.jar
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: HomeEssentials
path: ./dist
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Rename JAR to include version
run: |
cd dist
mv HomeEssentials-*.jar HomeEssentials-${{ steps.version.outputs.VERSION }}.jar
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: HomeEssentials v${{ steps.version.outputs.VERSION }}
body: |
## HomeEssentials v${{ steps.version.outputs.VERSION }}
A home management plugin for Hytale servers.
### Installation
1. Download `HomeEssentials-${{ steps.version.outputs.VERSION }}.jar` below
2. Place in your Hytale server's `mods/` folder
3. Restart the server
### Quick Setup
Run in server console:
```
perm group add default homes.use
perm group add default homes.limit.1
```
### Commands
| Command | Description |
|---------|-------------|
| `/sethome [name]` | Save your location |
| `/home [name]` | Teleport to home |
| `/homes` | List all homes |
| `/delhome <name>` | Delete a home |
| `/homehelp` | Show full help |
### Permissions
| Permission | Description |
|------------|-------------|
| `homes.use` | Basic access |
| `homes.limit.1` | 1 home (default) |
| `homes.limit.3` | 3 homes |
| `homes.limit.5` | 5 homes |
| `homes.limit.unlimited` | Unlimited |
files: ./dist/HomeEssentials-${{ steps.version.outputs.VERSION }}.jar
draft: false
prerelease: false