Make definition of ci and projects dynamic (#33)
* Make definition of ci and projects dynamic * Try defining matrix properly * Working impl * Fix target task * Fix path
This commit is contained in:
+25
-23
@@ -8,31 +8,33 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
define-versions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.versions.outputs.versions }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Define Versions
|
||||||
|
id: versions
|
||||||
|
run: |
|
||||||
|
versions="["
|
||||||
|
for item in $(ls mc); do
|
||||||
|
versions+="\"$item\", "
|
||||||
|
done
|
||||||
|
|
||||||
|
versions="${versions%,*}]"
|
||||||
|
echo "versions=$versions" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
needs: define-versions
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [
|
version: ${{ fromJSON(needs.define-versions.outputs.versions) }}
|
||||||
"1.7",
|
|
||||||
"1.8.9",
|
|
||||||
"1.9.4",
|
|
||||||
"1.10.2",
|
|
||||||
"1.11.2",
|
|
||||||
"1.12.2",
|
|
||||||
"1.13",
|
|
||||||
"1.14",
|
|
||||||
"1.15",
|
|
||||||
"1.16",
|
|
||||||
"1.17",
|
|
||||||
"1.18",
|
|
||||||
"22w19a",
|
|
||||||
"1.19",
|
|
||||||
"1.19.2",
|
|
||||||
"1.20",
|
|
||||||
"1.20.4",
|
|
||||||
"1.20.5",
|
|
||||||
"1.21"
|
|
||||||
]
|
|
||||||
|
|
||||||
name: Build ${{ matrix.version }}
|
name: Build ${{ matrix.version }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -55,11 +57,11 @@ jobs:
|
|||||||
- name: Generate ${{ matrix.version }}
|
- name: Generate ${{ matrix.version }}
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
arguments: :${{ matrix.version }}:runServer
|
arguments: :mc:${{ matrix.version }}:runServer
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: data-${{ matrix.version }}
|
name: data-${{ matrix.version }}
|
||||||
path: ${{ matrix.version }}/run/server/minecraft-data
|
path: mc/${{ matrix.version }}/run/server/minecraft-data
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ Just replace `<version>` with the version you want to generate.
|
|||||||
For Linux/Mac OS:
|
For Linux/Mac OS:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./gradlew :<version>:runServer
|
./gradlew :mc:<version>:runServer
|
||||||
```
|
```
|
||||||
|
|
||||||
For Windows:
|
For Windows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gradlew.bat :<version>:runServer
|
gradlew.bat :mc:<version>:runServer
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then find the minecraft-data in the `<version>/run/minecraft-data` directory.
|
You can then find the minecraft-data in the `mc/<version>/run/minecraft-data` directory.
|
||||||
|
|
||||||
## Adding a new version
|
## Adding a new version
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user