Update version to 1.0.2-alpha in build.gradle.kts and enhance release workflow in release.yml
All checks were successful
Build and Release / build (push) Successful in 2m4s

This commit is contained in:
Илья Глазунов 2025-12-22 20:39:18 +03:00
parent 2625155037
commit 35c3b1d4fc
2 changed files with 57 additions and 34 deletions

View File

@ -28,43 +28,66 @@ jobs:
id: get_version id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create Release - name: Find JAR file
uses: actions/forgejo-release@v2 id: find_jar
with: run: |
direction: upload JAR_FILE=$(find build/libs -name "*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" | head -1)
url: ${{ github.server_url }} echo "JAR_PATH=$JAR_FILE" >> $GITHUB_OUTPUT
token: ${{ secrets.RELEASE_TOKEN }} echo "JAR_NAME=$(basename $JAR_FILE)" >> $GITHUB_OUTPUT
release-dir: build/libs
release-notes: |
## Release ${{ steps.get_version.outputs.VERSION }}
### What's New - name: Create Draft Release
- Feature 1 run: |
- Feature 2 VERSION="${{ steps.get_version.outputs.VERSION }}"
### Bug Fixes RELEASE_BODY="## Release ${VERSION}
- Fix 1
- Fix 2
### Changes ### What's New
- Change 1 - Feature 1
- Change 2 - Feature 2
### Breaking Changes ### Bug Fixes
- None - Fix 1
- Fix 2
### Installation ### Changes
1. Download the JAR file from the assets below - Change 1
2. Place it in your server's `plugins` folder - Change 2
3. Restart the server
### Requirements ### Breaking Changes
- Minecraft Server with PaperMC: 1.21.11 - None
- Java: 21+
--- ### Installation
**Full Changelog**: Compare with previous version 1. Download the JAR file from the assets below
tag: ${{ steps.get_version.outputs.VERSION }} 2. Place it in your server's \`plugins\` folder
title: Release ${{ steps.get_version.outputs.VERSION }} 3. Restart the server
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"

View File

@ -5,7 +5,7 @@ plugins {
} }
group = "com.rpserver" group = "com.rpserver"
version = "1.0.0-alpha" version = "1.0.2-alpha"
java { java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21)) toolchain.languageVersion.set(JavaLanguageVersion.of(21))