@@ -2,14 +2,23 @@ name: Release to CurseForge and Modrinth
22
33on :
44 release :
5- types : [created]
5+ types : [created, published]
6+ workflow_dispatch :
7+ inputs :
8+ release_tag :
9+ description : ' Release tag to process (e.g., v1.20.4)'
10+ required : false
11+ type : string
612
713jobs :
814 build-and-release :
915 runs-on : ubuntu-latest
1016 steps :
1117 - name : Checkout code
1218 uses : actions/checkout@v3
19+ with :
20+ # If workflow_dispatch, checkout the tag
21+ ref : ${{ github.event.inputs.release_tag || github.ref }}
1322
1423 - name : Set up JDK 17
1524 uses : actions/setup-java@v3
2433 - name : Get artifact info
2534 id : artifact
2635 run : |
36+ # For workflow_dispatch, use the input tag, otherwise use the ref name
37+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+ VERSION="${{ github.event.inputs.release_tag }}"
39+ else
40+ VERSION="${GITHUB_REF_NAME}"
41+ fi
42+ VERSION="${VERSION#v}" # Remove 'v' prefix if present
2743 echo "jar_path=$(find target/ -name 'MinecraftServerAPI-*.jar' | head -n 1)" >> $GITHUB_OUTPUT
28- echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
44+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
45+ echo "Processing version: ${VERSION}"
46+
47+ - name : Extract game version from branch or tag
48+ id : game_version
49+ run : |
50+ # Get the version for game-versions field
51+ VERSION="${{ steps.artifact.outputs.version }}"
52+ # Extract just the Minecraft version (e.g., 1.20.4 from v1.20.4)
53+ MC_VERSION=$(echo "$VERSION" | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?')
54+ echo "minecraft_version=${MC_VERSION}" >> $GITHUB_OUTPUT
55+ echo "Minecraft version: ${MC_VERSION}"
2956
3057 - name : Upload to Modrinth & Curseforge
3158 uses : Kir-Antipov/mc-publish@v3.3
@@ -38,21 +65,26 @@ jobs:
3865
3966 files : ${{ steps.artifact.outputs.jar_path }}
4067
41- name : MinecraftServerAPI ${{ github.ref_name }}
68+ name : MinecraftServerAPI ${{ steps.artifact.outputs.version }}
4269 version : msa-${{ steps.artifact.outputs.version }}
4370 version-type : release
4471 game-versions : |
45- >=1.21
72+ ${{ steps.game_version.outputs.minecraft_version }}
4673 loaders : |
4774 paper
4875 spigot
4976 bukkit
5077 changelog : |
51- See [GitHub Release](${{ github.event.release.html_url }}) for changelog.
52-
53- - name : Upload to release
54- uses : softprops/action-gh-release@v1
55- with :
56- files : target/MinecraftServerAPI-*.jar
57- env :
58- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+ ## MinecraftServerAPI v${{ steps.artifact.outputs.version }}
79+
80+ ### Changes
81+ - Rebased on latest master branch
82+ - Includes all current features and bugfixes
83+
84+ ### Minecraft Version
85+ Supports Minecraft ${{ steps.game_version.outputs.minecraft_version }}
86+
87+ ### Installation
88+ Download the JAR file and place it in your Minecraft server's `plugins` folder.
89+
90+ For full documentation, see: https://github.com/${{ github.repository }}
0 commit comments