|
18 | 18 | java-version: '17' |
19 | 19 | cache: 'maven' |
20 | 20 |
|
21 | | - - name: Extract branch name and determine Minecraft version |
22 | | - id: extract_branch |
23 | | - run: | |
24 | | - BRANCH_NAME=${GITHUB_REF_NAME} |
25 | | - echo "Branch name: $BRANCH_NAME" |
26 | | - |
27 | | - # Extract Minecraft version from branch name (e.g., 1.19.x -> 1.19) |
28 | | - if [[ $BRANCH_NAME =~ ([0-9]+\.[0-9]+)\.x ]]; then |
29 | | - MC_VERSION=${BASH_REMATCH[1]} |
30 | | - echo "Detected Minecraft version: $MC_VERSION" |
31 | | - echo "mc_version=$MC_VERSION" >> $GITHUB_OUTPUT |
32 | | - |
33 | | - # Create a list of compatible game versions based on the branch |
34 | | - if [[ $MC_VERSION == "1.19" ]]; then |
35 | | - echo "game_versions=1.19,1.19.1,1.19.2,1.19.3,1.19.4" >> $GITHUB_OUTPUT |
36 | | - elif [[ $MC_VERSION == "1.20" ]]; then |
37 | | - echo "game_versions=1.20,1.20.1,1.20.2,1.20.3,1.20.4" >> $GITHUB_OUTPUT |
38 | | - elif [[ $MC_VERSION == "1.21" ]]; then |
39 | | - echo "game_versions=1.21,1.21.1" >> $GITHUB_OUTPUT |
40 | | - elif [[ $MC_VERSION == "1.18" ]]; then |
41 | | - echo "game_versions=1.18,1.18.1,1.18.2" >> $GITHUB_OUTPUT |
42 | | - else |
43 | | - # For other versions, use the exact version and ensure it's not empty |
44 | | - echo "game_versions=$MC_VERSION" >> $GITHUB_OUTPUT |
45 | | - # Add a fallback in case the version extraction fails |
46 | | - if [[ -z "$MC_VERSION" ]]; then |
47 | | - echo "Fallback to a default version" |
48 | | - echo "game_versions=1.19,1.20,1.21" >> $GITHUB_OUTPUT |
49 | | - fi |
50 | | - fi |
51 | | -
|
52 | | - # Store the game versions for debugging |
53 | | - GAME_VERSIONS=$(grep -oP 'game_versions=\K.*' $GITHUB_OUTPUT) |
54 | | - echo "Compatible game versions: $GAME_VERSIONS" |
55 | | - else |
56 | | - echo "Could not determine Minecraft version from branch name: $BRANCH_NAME" |
57 | | - exit 1 |
58 | | - fi |
59 | | -
|
60 | 21 | - name: Build with Maven |
61 | 22 | run: mvn clean package -DskipTests |
62 | 23 |
|
|
77 | 38 |
|
78 | 39 | files: ${{ steps.artifact.outputs.jar_path }} |
79 | 40 |
|
80 | | - name: MinecraftServerAPI ${GITHUB_REF_NAME} |
81 | | - version: ${GITHUB_REF_NAME}-${{ steps.artifact.outputs.version }} |
| 41 | + name: MinecraftServerAPI ${{ GITHUB_REF_NAME }} |
| 42 | + version: msa-${{ steps.artifact.outputs.version }} |
82 | 43 | version-type: release |
| 44 | + game-versions: | |
| 45 | + >=1.19 <1.20 |
83 | 46 | loaders: | |
84 | 47 | paper |
85 | 48 | spigot |
|
0 commit comments