From 35c3b1d4fc49203e38109085ec9af00cec9ca370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=93=D0=BB=D0=B0=D0=B7=D1=83?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Mon, 22 Dec 2025 20:39:18 +0300 Subject: [PATCH] Update version to 1.0.2-alpha in build.gradle.kts and enhance release workflow in release.yml --- .gitea/workflows/release.yml | 89 +++++++++++++++++++++++------------- build.gradle.kts | 2 +- 2 files changed, 57 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4acca4e..d4d1076 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -28,43 +28,66 @@ jobs: id: get_version run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - name: Create Release - uses: actions/forgejo-release@v2 - with: - direction: upload - url: ${{ github.server_url }} - token: ${{ secrets.RELEASE_TOKEN }} - release-dir: build/libs - release-notes: | - ## Release ${{ steps.get_version.outputs.VERSION }} + - name: Find JAR file + id: find_jar + run: | + JAR_FILE=$(find build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" | head -1) + echo "JAR_PATH=$JAR_FILE" >> $GITHUB_OUTPUT + echo "JAR_NAME=$(basename $JAR_FILE)" >> $GITHUB_OUTPUT - ### What's New - - Feature 1 - - Feature 2 + - name: Create Draft Release + run: | + VERSION="${{ steps.get_version.outputs.VERSION }}" + + RELEASE_BODY="## Release ${VERSION} - ### Bug Fixes - - Fix 1 - - Fix 2 + ### What's New + - Feature 1 + - Feature 2 - ### Changes - - Change 1 - - Change 2 + ### Bug Fixes + - Fix 1 + - Fix 2 - ### Breaking Changes - - None + ### Changes + - Change 1 + - Change 2 - ### Installation - 1. Download the JAR file from the assets below - 2. Place it in your server's `plugins` folder - 3. Restart the server + ### Breaking Changes + - None - ### Requirements - - Minecraft Server with PaperMC: 1.21.11 - - Java: 21+ + ### Installation + 1. Download the JAR file from the assets below + 2. Place it in your server's \`plugins\` folder + 3. Restart the server - --- - **Full Changelog**: Compare with previous version - tag: ${{ steps.get_version.outputs.VERSION }} - title: Release ${{ steps.get_version.outputs.VERSION }} - prerelease: false - draft: true + ### Requirements + - Minecraft Server with PaperMC: 1.21.11 + - Java: 21+" + + # Create draft release + RESPONSE=$(curl -s -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: application/json" \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \ + -d "{ + \"tag_name\": \"${VERSION}\", + \"name\": \"Release ${VERSION}\", + \"body\": $(echo "$RELEASE_BODY" | jq -Rs .), + \"draft\": true, + \"prerelease\": false + }") + + RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') + echo "Created release with ID: $RELEASE_ID" + echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV + + - name: Upload JAR to Release + run: | + curl -s -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: application/java-archive" \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets?name=${{ steps.find_jar.outputs.JAR_NAME }}" \ + --data-binary @"${{ steps.find_jar.outputs.JAR_PATH }}" + + echo "Uploaded ${{ steps.find_jar.outputs.JAR_NAME }} to release" diff --git a/build.gradle.kts b/build.gradle.kts index 44f159e..205b72c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "com.rpserver" -version = "1.0.0-alpha" +version = "1.0.2-alpha" java { toolchain.languageVersion.set(JavaLanguageVersion.of(21))