|
| 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 |
0 commit comments