diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-04-04 20:26:37 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-04-04 20:26:37 +0900 |
| commit | 2b0829856c9a24b90a9248d28c7de84101b83232 (patch) | |
| tree | 63160192d490543ae7c1fc4a16286397da8261ee /.github | |
| parent | 9027d9f04fb833f428d6ef528cb19542cef8bd49 (diff) | |
| download | LunaticChat-2b0829856c9a24b90a9248d28c7de84101b83232.tar.gz LunaticChat-2b0829856c9a24b90a9248d28c7de84101b83232.tar.bz2 LunaticChat-2b0829856c9a24b90a9248d28c7de84101b83232.zip | |
feat: Improving Velocity's Cycling Compatibility
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/release-nightly.yaml (renamed from .github/workflows/nightly.yaml) | 24 | ||||
| -rw-r--r-- | .github/workflows/release-paper.yaml | 140 | ||||
| -rw-r--r-- | .github/workflows/release-velocity.yaml | 139 | ||||
| -rw-r--r-- | .github/workflows/release.yaml | 62 |
4 files changed, 321 insertions, 44 deletions
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/release-nightly.yaml index e6d69f9..daa31fe 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/release-nightly.yaml @@ -47,16 +47,19 @@ jobs: - name: Compute nightly version id: version run: | - BASE_VERSION=$(grep '?: "' build.gradle.kts | head -1 | sed 's/.*?: "\(.*\)"/\1/') - if [ -z "$BASE_VERSION" ]; then - BASE_VERSION="1.0.0" - fi + PAPER_BASE=$(grep '^paperVersion=' gradle.properties | cut -d'=' -f2) + VELOCITY_BASE=$(grep '^velocityVersion=' gradle.properties | cut -d'=' -f2) 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" + + PAPER_NIGHTLY="${PAPER_BASE}-nightly.${SHORT_HASH}" + VELOCITY_NIGHTLY="${VELOCITY_BASE}-nightly.${SHORT_HASH}" + + echo "version=${PAPER_NIGHTLY}" >> $GITHUB_OUTPUT + echo "paper_version=${PAPER_NIGHTLY}" >> $GITHUB_OUTPUT + echo "velocity_version=${VELOCITY_NIGHTLY}" >> $GITHUB_OUTPUT + echo "paper_jar_name=LunaticChat-${PAPER_NIGHTLY}.jar" >> $GITHUB_OUTPUT + echo "velocity_jar_name=LunaticChat-${VELOCITY_NIGHTLY}-velocity.jar" >> $GITHUB_OUTPUT + echo "Paper nightly: $PAPER_NIGHTLY, Velocity nightly: $VELOCITY_NIGHTLY" - name: Setup Development Environment uses: jdx/mise-action@v4 @@ -70,7 +73,8 @@ jobs: - name: Build with shadowJar run: | ./gradlew :platform-paper:shadowJar :platform-velocity:shadowJar \ - -Pversion="${{ steps.version.outputs.version }}" \ + -PpaperVersion="${{ steps.version.outputs.paper_version }}" \ + -PvelocityVersion="${{ steps.version.outputs.velocity_version }}" \ -PisNightly=true \ --parallel --no-daemon diff --git a/.github/workflows/release-paper.yaml b/.github/workflows/release-paper.yaml new file mode 100644 index 0000000..49c9af8 --- /dev/null +++ b/.github/workflows/release-paper.yaml @@ -0,0 +1,140 @@ +name: Release Paper + +on: + push: + tags: + - 'paper/v*' + +jobs: + validate: + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.get_version.outputs.version }} + jar_name: ${{ steps.get_version.outputs.jar_name }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Extract version from tag and validate + id: get_version + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/paper/v} + GRADLE_VERSION=$(grep '^paperVersion=' gradle.properties | cut -d'=' -f2) + + if [ "$TAG_VERSION" != "$GRADLE_VERSION" ]; then + echo "Error: Tag version ($TAG_VERSION) does not match gradle.properties paperVersion ($GRADLE_VERSION)" + exit 1 + fi + + echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT + echo "jar_name=LunaticChat-$TAG_VERSION.jar" >> $GITHUB_OUTPUT + echo "Version validation passed: $TAG_VERSION" + + - name: Check if release already exists + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + if gh release view "$TAG_NAME" &> /dev/null; then + echo "Error: Release $TAG_NAME already exists" + exit 1 + fi + echo "Release validation passed: $TAG_NAME does not exist yet" + + build: + runs-on: ubuntu-24.04 + needs: validate + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Development Environment + uses: jdx/mise-action@v4 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Paper shadowJar + run: ./gradlew :platform-paper:shadowJar --no-daemon + + - name: Upload build artifact + uses: actions/upload-artifact@v7 + with: + name: LunaticChat-paper-v${{ needs.validate.outputs.version }} + path: platform-paper/build/libs/${{ needs.validate.outputs.jar_name }} + retention-days: 90 + + release: + runs-on: ubuntu-24.04 + needs: [validate, build] + permissions: + contents: write + env: + MODRINTH_CHANNEL: release + MODRINTH_PAPER_GAME_VERSIONS: "26.1.x" + MODRINTH_MC_VERSION: "26.1" + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + name: LunaticChat-paper-v${{ needs.validate.outputs.version }} + + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + VERSION=${{ needs.validate.outputs.version }} + JAR_NAME=${{ needs.validate.outputs.jar_name }} + + cat > /tmp/release-notes.md <<EOF + LunaticChat Paper/Folia v${VERSION} has been released. + + ## Download + + - [GitHub](https://github.com/m1sk9/LunaticChat/releases/tag/${TAG_NAME}) + - [Modrinth (Paper/Folia)](https://modrinth.com/plugin/lunaticchat/version/${VERSION}) + + ## What's new + + ### Highlights + + ### New Features + + ### Improvements + + ### Changes + + ### Bug Fixes + + ### Notes + + EOF + + gh release create "$TAG_NAME" \ + "platform-paper/build/libs/$JAR_NAME" \ + --title "$TAG_NAME" \ + --draft \ + --notes-file /tmp/release-notes.md + + - name: Publish to Modrinth (Paper/Folia) + uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 + with: + token: ${{ secrets.MODRINTH_TOKEN }} + name: v${{ needs.validate.outputs.version }} (Paper/Folia v${{ env.MODRINTH_MC_VERSION }}) + project: ${{ secrets.MODRINTH_PROJECT_ID }} + version: ${{ needs.validate.outputs.version }} + channel: ${{ env.MODRINTH_CHANNEL }} + changelog: |- + Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/paper/v${{ needs.validate.outputs.version }}) for update details. + loaders: |- + paper + folia + game-versions: ${{ env.MODRINTH_PAPER_GAME_VERSIONS }} + files: platform-paper/build/libs/${{ needs.validate.outputs.jar_name }} diff --git a/.github/workflows/release-velocity.yaml b/.github/workflows/release-velocity.yaml new file mode 100644 index 0000000..6a78ea5 --- /dev/null +++ b/.github/workflows/release-velocity.yaml @@ -0,0 +1,139 @@ +name: Release Velocity + +on: + push: + tags: + - 'velocity/v*' + +jobs: + validate: + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.get_version.outputs.version }} + jar_name: ${{ steps.get_version.outputs.jar_name }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Extract version from tag and validate + id: get_version + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/velocity/v} + GRADLE_VERSION=$(grep '^velocityVersion=' gradle.properties | cut -d'=' -f2) + + if [ "$TAG_VERSION" != "$GRADLE_VERSION" ]; then + echo "Error: Tag version ($TAG_VERSION) does not match gradle.properties velocityVersion ($GRADLE_VERSION)" + exit 1 + fi + + echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT + echo "jar_name=LunaticChat-$TAG_VERSION-velocity.jar" >> $GITHUB_OUTPUT + echo "Version validation passed: $TAG_VERSION" + + - name: Check if release already exists + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + if gh release view "$TAG_NAME" &> /dev/null; then + echo "Error: Release $TAG_NAME already exists" + exit 1 + fi + echo "Release validation passed: $TAG_NAME does not exist yet" + + build: + runs-on: ubuntu-24.04 + needs: validate + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Development Environment + uses: jdx/mise-action@v4 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Velocity shadowJar + run: ./gradlew :platform-velocity:shadowJar --no-daemon + + - name: Upload build artifact + uses: actions/upload-artifact@v7 + with: + name: LunaticChat-velocity-v${{ needs.validate.outputs.version }} + path: platform-velocity/build/libs/${{ needs.validate.outputs.jar_name }} + retention-days: 90 + + release: + runs-on: ubuntu-24.04 + needs: [validate, build] + permissions: + contents: write + env: + MODRINTH_CHANNEL: release + MODRINTH_VELOCITY_GAME_VERSIONS: |- + 1.21.x + 26.1.x + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download build artifact + uses: actions/download-artifact@v8 + with: + name: LunaticChat-velocity-v${{ needs.validate.outputs.version }} + + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + VERSION=${{ needs.validate.outputs.version }} + JAR_NAME=${{ needs.validate.outputs.jar_name }} + + cat > /tmp/release-notes.md <<EOF + LunaticChat Velocity v${VERSION} has been released. + + ## Download + + - [GitHub](https://github.com/m1sk9/LunaticChat/releases/tag/${TAG_NAME}) + - [Modrinth (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-velocity/build/libs/$JAR_NAME" \ + --title "$TAG_NAME" \ + --draft \ + --notes-file /tmp/release-notes.md + + - name: Publish to Modrinth (Velocity) + uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 + with: + token: ${{ secrets.MODRINTH_TOKEN }} + name: v${{ needs.validate.outputs.version }} (Velocity) + project: ${{ secrets.MODRINTH_PROJECT_ID }} + version: ${{ needs.validate.outputs.version }}-velocity + channel: ${{ env.MODRINTH_CHANNEL }} + changelog: |- + Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/velocity/v${{ needs.validate.outputs.version }}) for update details. + loaders: velocity + game-versions: ${{ env.MODRINTH_VELOCITY_GAME_VERSIONS }} + files: platform-velocity/build/libs/${{ needs.validate.outputs.jar_name }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aaa22a3..f8000b4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,32 +9,25 @@ jobs: validate: runs-on: ubuntu-24.04 outputs: - version: ${{ steps.get_version.outputs.version }} + paper_version: ${{ steps.get_version.outputs.paper_version }} + velocity_version: ${{ steps.get_version.outputs.velocity_version }} paper_jar_name: ${{ steps.get_version.outputs.paper_jar_name }} velocity_jar_name: ${{ steps.get_version.outputs.velocity_jar_name }} steps: - name: Checkout repository uses: actions/checkout@v6 - - name: Extract version from build.gradle.kts + - name: Extract versions from gradle.properties id: get_version run: | - VERSION=$(grep ' version = ' build.gradle.kts | sed 's/.*version = "\(.*\)"/\1/') - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "paper_jar_name=LunaticChat-$VERSION.jar" >> $GITHUB_OUTPUT - echo "velocity_jar_name=LunaticChat-$VERSION-velocity.jar" >> $GITHUB_OUTPUT - echo "Extracted version: $VERSION" + PAPER_VERSION=$(grep '^paperVersion=' gradle.properties | cut -d'=' -f2) + VELOCITY_VERSION=$(grep '^velocityVersion=' gradle.properties | cut -d'=' -f2) - - name: Validate tag matches version - run: | - TAG_VERSION=${GITHUB_REF#refs/tags/v} - GRADLE_VERSION="${{ steps.get_version.outputs.version }}" - - if [ "$TAG_VERSION" != "$GRADLE_VERSION" ]; then - echo "Error: Tag version ($TAG_VERSION) does not match build.gradle.kts version ($GRADLE_VERSION)" - exit 1 - fi - echo "Version validation passed: $TAG_VERSION" + echo "paper_version=$PAPER_VERSION" >> $GITHUB_OUTPUT + echo "velocity_version=$VELOCITY_VERSION" >> $GITHUB_OUTPUT + echo "paper_jar_name=LunaticChat-$PAPER_VERSION.jar" >> $GITHUB_OUTPUT + echo "velocity_jar_name=LunaticChat-$VELOCITY_VERSION-velocity.jar" >> $GITHUB_OUTPUT + echo "Paper version: $PAPER_VERSION, Velocity version: $VELOCITY_VERSION" - name: Check if release already exists env: @@ -69,7 +62,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v7 with: - name: LunaticChat-v${{ needs.validate.outputs.version }} + name: LunaticChat-${{ github.ref_name }} path: | platform-paper/build/libs/${{ needs.validate.outputs.paper_jar_name }} platform-velocity/build/libs/${{ needs.validate.outputs.velocity_jar_name }} @@ -94,28 +87,30 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v8 with: - name: LunaticChat-v${{ needs.validate.outputs.version }} - - - name: Get current date - id: get_date - run: echo "current_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + name: LunaticChat-${{ github.ref_name }} - name: Create GitHub Release env: GH_TOKEN: ${{ github.token }} run: | TAG_NAME=${GITHUB_REF#refs/tags/} - VERSION=${{ needs.validate.outputs.version }} + PAPER_VERSION=${{ needs.validate.outputs.paper_version }} + VELOCITY_VERSION=${{ needs.validate.outputs.velocity_version }} 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. + LunaticChat ${TAG_NAME} has been released. + + | Platform | Version | + |----------|---------| + | Paper/Folia | ${PAPER_VERSION} | + | Velocity | ${VELOCITY_VERSION} | ## 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) + - [GitHub](https://github.com/m1sk9/LunaticChat/releases/tag/${TAG_NAME}) + - Modrinth: [Paper/Folia](https://modrinth.com/plugin/lunaticchat/version/${PAPER_VERSION}), [Velocity](https://modrinth.com/plugin/lunaticchat/version/${VELOCITY_VERSION}-velocity) ## What's new @@ -144,12 +139,12 @@ jobs: uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 with: token: ${{ secrets.MODRINTH_TOKEN }} - name: v${{ needs.validate.outputs.version }} (Paper/Folia v${{ env.MODRINTH_MC_VERSION }}) + name: v${{ needs.validate.outputs.paper_version }} (Paper/Folia v${{ env.MODRINTH_MC_VERSION }}) project: ${{ secrets.MODRINTH_PROJECT_ID }} - version: ${{ needs.validate.outputs.version }} + version: ${{ needs.validate.outputs.paper_version }} channel: ${{ env.MODRINTH_CHANNEL }} changelog: |- - Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/v${{ needs.validate.outputs.version }}) for update details. + Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/${{ github.ref_name }}) for update details. loaders: |- paper folia @@ -160,13 +155,12 @@ jobs: uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2 with: token: ${{ secrets.MODRINTH_TOKEN }} - name: v${{ needs.validate.outputs.version }} (Velocity) + name: v${{ needs.validate.outputs.velocity_version }} (Velocity) project: ${{ secrets.MODRINTH_PROJECT_ID }} - version: ${{ needs.validate.outputs.version }}-velocity + version: ${{ needs.validate.outputs.velocity_version }}-velocity channel: ${{ env.MODRINTH_CHANNEL }} changelog: |- - Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/v${{ needs.validate.outputs.version }}) for update details. + Please refer to the [GitHub release](https://github.com/m1sk9/LunaticChat/releases/tag/${{ github.ref_name }}) for update details. loaders: velocity game-versions: ${{ env.MODRINTH_VELOCITY_GAME_VERSIONS }} files: platform-velocity/build/libs/${{ needs.validate.outputs.velocity_jar_name }} - |
