diff options
| -rw-r--r-- | .github/workflows/nightly.yaml | 112 | ||||
| -rw-r--r-- | .github/workflows/release.yaml | 28 | ||||
| -rw-r--r-- | docker/paper/compose.yaml | 47 |
3 files changed, 185 insertions, 2 deletions
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000..6a162a2 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,112 @@ +name: Nightly Release + +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '*.md' + - 'LICENSE' + +concurrency: + group: nightly-release + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.version.outputs.version }} + paper_jar_name: ${{ steps.version.outputs.paper_jar_name }} + velocity_jar_name: ${{ steps.version.outputs.velocity_jar_name }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Compute nightly version + id: version + run: | + BASE_VERSION=$(grep ' version = ' build.gradle.kts | sed 's/.*version = "\(.*\)"/\1/' | sed "s/findProperty.*?: \"\(.*\)\"/\1/") + # Fallback: extract version from the default value + if [ -z "$BASE_VERSION" ] || echo "$BASE_VERSION" | grep -q 'findProperty'; then + BASE_VERSION="1.0.0" + fi + SHORT_HASH=$(git rev-parse --short HEAD) + NIGHTLY_VERSION="${BASE_VERSION}-nightly.${SHORT_HASH}" + echo "version=$NIGHTLY_VERSION" >> $GITHUB_OUTPUT + echo "paper_jar_name=LunaticChat-${NIGHTLY_VERSION}.jar" >> $GITHUB_OUTPUT + echo "velocity_jar_name=LunaticChat-${NIGHTLY_VERSION}-velocity.jar" >> $GITHUB_OUTPUT + echo "Nightly version: $NIGHTLY_VERSION" + + - name: Setup Development Environment + uses: jdx/mise-action@v3 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with shadowJar + run: | + ./gradlew :platform-paper:shadowJar :platform-velocity:shadowJar \ + -Pversion=${{ steps.version.outputs.version }} \ + -PisNightly=true \ + --parallel --no-daemon + + - name: Upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: LunaticChat-nightly-${{ steps.version.outputs.version }} + path: | + platform-paper/build/libs/${{ steps.version.outputs.paper_jar_name }} + platform-velocity/build/libs/${{ steps.version.outputs.velocity_jar_name }} + retention-days: 7 + + release: + runs-on: ubuntu-24.04 + needs: build + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + name: LunaticChat-nightly-${{ needs.build.outputs.version }} + + - name: Delete existing nightly release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release delete nightly --yes --cleanup-tag 2>/dev/null || true + + - name: Create nightly release + env: + GH_TOKEN: ${{ github.token }} + run: | + VERSION=${{ needs.build.outputs.version }} + PAPER_JAR_NAME=${{ needs.build.outputs.paper_jar_name }} + VELOCITY_JAR_NAME=${{ needs.build.outputs.velocity_jar_name }} + + gh release create nightly \ + "platform-paper/build/libs/$PAPER_JAR_NAME" \ + "platform-velocity/build/libs/$VELOCITY_JAR_NAME" \ + --title "Nightly Build ($VERSION)" \ + --prerelease \ + --notes "$(cat <<'EOF' + ## ⚠️ Nightly Build + + This is an automatically generated nightly build from the latest `main` branch. + + **Warning:** This build may be unstable or contain bugs. Do not use in production environments. + + - **Version:** `${{ needs.build.outputs.version }}` + - **Commit:** ${{ github.sha }} + + If you encounter any issues, please report them on [GitHub Issues](https://github.com/m1sk9/LunaticChat/issues). + EOF + )" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6360327..c134538 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -81,7 +81,7 @@ jobs: permissions: contents: write env: - MODRINTH_CHANNEL: beta + MODRINTH_CHANNEL: release MODRINTH_GAME_VERSIONS: "1.21.x" MODRINTH_MC_VERSION: "1.21.11" steps: @@ -106,12 +106,36 @@ jobs: PAPER_JAR_NAME=${{ needs.validate.outputs.paper_jar_name }} VELOCITY_JAR_NAME=${{ needs.validate.outputs.velocity_jar_name }} + cat > /tmp/release-notes.md <<EOF + LunaticChat v${VERSION} has been released. + + ## Download + + - [GitHub](https://github.com/m1sk9/LunaticChat/releases/tag/v${VERSION}) + - Modrinth: [Paper/Folia](https://modrinth.com/plugin/lunaticchat/version/${VERSION}), [Velocity](https://modrinth.com/plugin/lunaticchat/version/${VERSION}-velocity) + + ## What's new + + ### Highlights + + ### New Features + + ### Improvements + + ### Changes + + ### Bug Fixes + + ### Notes + + EOF + gh release create "$TAG_NAME" \ "platform-paper/build/libs/$PAPER_JAR_NAME" \ "platform-velocity/build/libs/$VELOCITY_JAR_NAME" \ --title "$TAG_NAME" \ --draft \ - --notes "" + --notes-file /tmp/release-notes.md - name: Publish to Modrinth (Paper/Folia) uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 diff --git a/docker/paper/compose.yaml b/docker/paper/compose.yaml new file mode 100644 index 0000000..5e171eb --- /dev/null +++ b/docker/paper/compose.yaml @@ -0,0 +1,47 @@ +services: + paper: + image: itzg/minecraft-server:java21 + container_name: debug-paper + ports: + - "25565:25565" + - "25575:25575" + volumes: + - lunatic-debug-paper-data:/data + - ./plugins:/data/plugins + - ../velocity/bukkit.yml:/data/bukkit.yml + environment: + EULA: "TRUE" + TYPE: "PAPER" + VERSION: "1.21.11" + MEMORY: "1G" + + # デバッグ用高速化設定 + LEVEL_TYPE: "flat" + VIEW_DISTANCE: "3" + SIMULATION_DISTANCE: "3" + GENERATE_STRUCTURES: "false" + SPAWN_PROTECTION: "0" + ALLOW_NETHER: "false" + + # 権限関連 + OVERRIDE_SERVER_PROPERTIES: "true" + + ENABLE_RCON: "true" + RCON_PASSWORD: "minecraft" + RCON_PORT: 25575 + + DIFFICULTY: "peaceful" + MAX_PLAYERS: "3" + ONLINE_MODE: "false" + SYNC_SKIP_NEWER_IN_DESTINATION: "false" + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 + tty: true + stdin_open: true + +volumes: + lunatic-debug-paper-data: |
