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 }}"
RELEASE_BODY="## Release ${VERSION}
### Bug Fixes ### What's New
- Fix 1 - Feature 1
- Fix 2 - Feature 2
### Changes ### Bug Fixes
- Change 1 - Fix 1
- Change 2 - Fix 2
### Breaking Changes ### Changes
- None - Change 1
- Change 2
### Installation ### Breaking Changes
1. Download the JAR file from the assets below - None
2. Place it in your server's `plugins` folder
3. Restart the server
### Requirements ### Installation
- Minecraft Server with PaperMC: 1.21.11 1. Download the JAR file from the assets below
- Java: 21+ 2. Place it in your server's \`plugins\` folder
3. Restart the server
--- ### Requirements
**Full Changelog**: Compare with previous version - Minecraft Server with PaperMC: 1.21.11
tag: ${{ steps.get_version.outputs.VERSION }} - Java: 21+"
title: Release ${{ steps.get_version.outputs.VERSION }}
prerelease: false # Create draft release
draft: true 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))