diff --git a/.github/actions/local-action/action.yml b/.github/actions/local-action/action.yml deleted file mode 100644 index 83af6c5..0000000 --- a/.github/actions/local-action/action.yml +++ /dev/null @@ -1,142 +0,0 @@ -name: 'Local Run Action' -description: 'Runs the MC client' - -inputs: - mc: - description: 'The MC version to run' - required: true - default: '1.20.4' - modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' - required: true - default: 'fabric' - regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' - required: true - default: '.*fabric.*' - java: - description: 'The Java version to use' - required: true - default: '17' - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - dummy-assets: - description: 'Whether to use Dummy Assets or not' - required: true - default: 'true' - mc-runtime-test: - description: 'The mc-runtime-test jar to download (none, lexforge, fabric or neoforge)' - required: true - default: 'fabric' - xvfb: - description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' - required: false - default: 'true' - headlessmc-command: - description: 'Arguments for the headlessmc command.' - required: false - default: '--jvm -Djava.awt.headless=true' - fabric-api: - description: 'Downloads the Fabric-API from https://maven.fabricmc.net/. Supply the version (e.g. 0.97.0, or none)' - required: false - default: 'none' - fabric-gametest-api: - description: 'Downloads the Fabric-GameTest-API from https://maven.fabricmc.net/. Supply the version (e.g. 1.3.5+85d85a934f, or none)' - required: false - default: 'none' - checkout: - description: 'Only for this local repository action, checks out the code if true' - required: false - default: 'true' - download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' - required: false - default: 'true' - hmc-version: - description: 'The version of headlessmc to download.' - required: false - default: '2.4.1' - -runs: - using: "composite" - steps: - - name: Check out code - if: ${{ inputs.checkout == 'true' }} - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java }} - distribution: ${{ inputs.java-distribution }} - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - shell: bash - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - shell: bash - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - shell: bash - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - shell: bash - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - shell: bash - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - shell: bash - - name: Configure Dummy Assets - if: ${{ inputs.dummy-assets == 'true' }} - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - shell: bash - - name: Get HeadlessMC - if: ${{ inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ inputs.hmc-version }}/headlessmc-launcher-${{ inputs.hmc-version }}.jar - shell: bash - - name: Download ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ inputs.mc }} - shell: bash - - name: Download Fabric ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ inputs.modloader }} ${{ inputs.mc }} --java ${{ inputs.java }} - shell: bash - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - shell: bash - - name: Make mods dir - run: mkdir -p run/mods - shell: bash - - name: Download mc-runtime-test jar ${{ inputs.mc-runtime-test }} - if: ${{ inputs.mc-runtime-test != 'none' }} - run: wget -O run/mods/mc-runtime-test-${{ inputs.mc }}-2.4.2-${{ inputs.mc-runtime-test }}-release.jar https://github.com/3arthqu4ke/mc-runtime-test/releases/download/2.4.2/mc-runtime-test-${{ inputs.mc }}-2.4.2-${{ inputs.mc-runtime-test }}-release.jar - shell: bash - - name: Download fabric-api jar ${{ inputs.fabric-api }} - if: ${{ inputs.fabric-api != 'none' }} - run: wget -O run/mods/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/${{ inputs.fabric-api }}+${{ inputs.mc }}/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar - shell: bash - - name: Download fabric-gametest-api jar ${{ inputs.fabric-gametest-api }} - if: ${{ inputs.fabric-gametest-api != 'none' }} - run: wget -O run/mods/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-gametest-api-v1/${{ inputs.fabric-gametest-api }}/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar - shell: bash - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - shell: bash - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - shell: bash - - name: LS mods dir - run: ls run/mods - shell: bash - - name: Install xrandr - if: ${{ inputs.xvfb == 'true' }} - run: sudo apt install x11-xserver-utils - shell: bash - - name: Run game with xvfb - if: ${{ inputs.xvfb == 'true' }} - run: xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash - - name: Run game - if: ${{ inputs.xvfb != 'true' }} - run: java -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash diff --git a/.github/workflows/build-all-matrix-artifacts.yml b/.github/workflows/build-all-matrix-artifacts.yml deleted file mode 100644 index a8afeae..0000000 --- a/.github/workflows/build-all-matrix-artifacts.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build All With Artifacts -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - strategy: - matrix: - version: - - { dir: api, mc: api, lex: api, neo: api, java: 8 } - - { dir: 1_21, mc: 1.21.3, lex: 53.0.7, neo: 11-beta, java: 21 } - - { dir: 1_21, mc: 1.21.1, lex: 52.0.2, neo: 4, java: 21 } - - { dir: 1_21, mc: 1.21, lex: 51.0.24, neo: 96-beta, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, lex: 50.1.10, neo: 119, java: 21 } - - { dir: 1_20, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } - - { dir: 1_20, mc: 1.20.3, lex: 49.0.2, neo: 8-beta, java: 17 } - - { dir: 1_20, mc: 1.20.2, lex: 48.1.0, neo: 88, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, lex: 47.2.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.4, lex: 45.2.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.3, lex: 44.1.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.2, lex: 43.3.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.1, lex: 42.0.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19, lex: 41.1.0, neo: 0, java: 17 } - - { dir: 1_18, mc: 1.18.2, lex: 40.2.18, neo: 0, java: 17 } - - { dir: 1_17, mc: 1.17.1, lex: 37.1.1, neo: 0, java: 16 } - - { dir: 1_16, mc: 1.16.5, lex: 36.2.42, neo: 0, java: 8 } - - { dir: 1_12, mc: 1.12.2, lex: 14.23.5.2860, neo: 0, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, lex: 11.15.1.2318-1.8.9, neo: 0, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, lex: 10.13.4.1614-1.7.10, neo: 0, java: 8 } - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.version.java }} - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./${{ matrix.version.dir }} - run: chmod +x gradlew - - name: Build - working-directory: ./${{ matrix.version.dir }} - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} -Pneoforge_version=${{ matrix.version.neo }} --stacktrace - - name: Upload ${{ matrix.version.mc }} Jars - uses: actions/upload-artifact@v4 - with: - name: jars-${{ matrix.version.mc }} - path: ./${{ matrix.version.dir }}/build/libs/*.jar - - merge: - runs-on: ubuntu-latest - needs: build - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - delete-merged: true - \ No newline at end of file diff --git a/.github/workflows/build-all-matrix.yml b/.github/workflows/build-all-matrix.yml deleted file mode 100644 index abc941c..0000000 --- a/.github/workflows/build-all-matrix.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build All -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - strategy: - matrix: - version: - - { dir: api, mc: api, lex: api, neo: api, java: 8 } - - { dir: 1_21, mc: 1.21.3, lex: 53.0.7, neo: 11-beta, java: 21 } - - { dir: 1_21, mc: 1.21.1, lex: 52.0.2, neo: 4, java: 21 } - - { dir: 1_21, mc: 1.21, lex: 51.0.24, neo: 96-beta, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, lex: 50.1.10, neo: 119, java: 21 } - - { dir: 1_20, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } - - { dir: 1_20, mc: 1.20.3, lex: 49.0.2, neo: 8-beta, java: 17 } - - { dir: 1_20, mc: 1.20.2, lex: 48.1.0, neo: 88, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, lex: 47.2.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.4, lex: 45.2.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.3, lex: 44.1.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.2, lex: 43.3.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.1, lex: 42.0.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19, lex: 41.1.0, neo: 0, java: 17 } - - { dir: 1_18, mc: 1.18.2, lex: 40.2.18, neo: 0, java: 17 } - - { dir: 1_17, mc: 1.17.1, lex: 37.1.1, neo: 0, java: 16 } - - { dir: 1_16, mc: 1.16.5, lex: 36.2.42, neo: 0, java: 8 } - - { dir: 1_12, mc: 1.12.2, lex: 14.23.5.2860, neo: 0, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, lex: 11.15.1.2318-1.8.9, neo: 0, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, lex: 10.13.4.1614-1.7.10, neo: 0, java: 8 } - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-specific-reusable.yml@main - with: - dir: ${{ matrix.version.dir }} - mc: ${{ matrix.version.mc }} - lex: ${{ matrix.version.lex }} - neo: ${{ matrix.version.neo }} - java: ${{ matrix.version.java }} diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml deleted file mode 100644 index 1f5e9f4..0000000 --- a/.github/workflows/build-all.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build matrices -on: - workflow_dispatch: - -jobs: - build-api: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-api.yml@main - build-1_7: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.7.yml@main - build-1_8: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.8.yml@main - build-1_12: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.12.yml@main - build-1_16: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.16.yml@main - build-1_17: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.17.yml@main - build-1_18: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.18.yml@main - build-1_19: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.19.yml@main - build-1_20_1: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.20.1.yml@main - build-1_20: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.20.yml@main - build-1_20_6: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.20.6.yml@main - build-1_21: - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-matrix-1.21.yml@main diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml deleted file mode 100644 index c1bbd77..0000000 --- a/.github/workflows/build-api.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build API - -on: - push: - workflow_call: - workflow_dispatch: - pull_request: - types: [opened, reopened] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 1.8 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'adopt' - - - name: Grant execute permission for gradlew - working-directory: ./api - run: chmod +x gradlew - - - name: Build with Gradle - working-directory: ./api - run: | - ./gradlew build --stacktrace diff --git a/.github/workflows/build-matrix-1.12.yml b/.github/workflows/build-matrix-1.12.yml deleted file mode 100644 index 6b29532..0000000 --- a/.github/workflows/build-matrix-1.12.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.12+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.12.2, lex: 14.23.5.2860} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_12 - run: chmod +x gradlew - - name: Build - working-directory: ./1_12 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.16.yml b/.github/workflows/build-matrix-1.16.yml deleted file mode 100644 index fb136cd..0000000 --- a/.github/workflows/build-matrix-1.16.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Build Matrix 1.16+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.16.5, lex: 36.2.42} ] - #version: [ {mc: 1.16.5, lex: 36.2.42}, {mc: 1.16.4, lex: 35.1.37}, {mc: 1.16.3, lex: 34.1.42}, {mc: 1.16.2, lex: 33.0.61}, {mc: 1.16.1, lex: 32.0.108} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_16 - run: chmod +x gradlew - - name: Build - working-directory: ./1_16 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.17.yml b/.github/workflows/build-matrix-1.17.yml deleted file mode 100644 index 5e3f23e..0000000 --- a/.github/workflows/build-matrix-1.17.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.17+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.17.1, lex: 37.1.1} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 16 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_17 - run: chmod +x gradlew - - name: Build - working-directory: ./1_17 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.18.yml b/.github/workflows/build-matrix-1.18.yml deleted file mode 100644 index b54e484..0000000 --- a/.github/workflows/build-matrix-1.18.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Build Matrix 1.18+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.18.2, lex: 40.2.18} ] - #version: [ {mc: 1.18.2, lex: 40.2.18}, {mc: 1.18.1, lex: 39.1.2}, {mc: 1.18, lex: 38.0.17} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_18 - run: chmod +x gradlew - - name: Build - working-directory: ./1_18 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.19.yml b/.github/workflows/build-matrix-1.19.yml deleted file mode 100644 index e02b4a5..0000000 --- a/.github/workflows/build-matrix-1.19.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.19+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.19.4, lex: 45.2.9}, {mc: 1.19.3, lex: 44.1.23}, {mc: 1.19.2, lex: 43.3.9}, {mc: 1.19.1, lex: 42.0.9}, {mc: 1.19, lex: 41.1.0} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_19 - run: chmod +x gradlew - - name: Build - working-directory: ./1_19 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.20.1.yml b/.github/workflows/build-matrix-1.20.1.yml deleted file mode 100644 index fd9e5a5..0000000 --- a/.github/workflows/build-matrix-1.20.1.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.20.1 -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.20.1, lex: 47.2.23} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_20/1_20_1 - run: chmod +x gradlew - - name: Build - working-directory: ./1_20/1_20_1 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.20.6.yml b/.github/workflows/build-matrix-1.20.6.yml deleted file mode 100644 index 66366ab..0000000 --- a/.github/workflows/build-matrix-1.20.6.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.20+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.20.6, lex: 50.1.10, neo: 119} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_20/1_20_6 - run: chmod +x gradlew - - name: Build - working-directory: ./1_20/1_20_6 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} -Pneoforge_version=${{ matrix.version.neo }} --stacktrace diff --git a/.github/workflows/build-matrix-1.20.yml b/.github/workflows/build-matrix-1.20.yml deleted file mode 100644 index 7cc4bf9..0000000 --- a/.github/workflows/build-matrix-1.20.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.20+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.20.4, lex: 49.0.38, neo: 219}, {mc: 1.20.3, lex: 49.0.2, neo: 8-beta}, {mc: 1.20.2, lex: 48.1.0, neo: 88} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_20 - run: chmod +x gradlew - - name: Build - working-directory: ./1_20 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} -Pneoforge_version=${{ matrix.version.neo }} --stacktrace diff --git a/.github/workflows/build-matrix-1.21.yml b/.github/workflows/build-matrix-1.21.yml deleted file mode 100644 index 5b414a8..0000000 --- a/.github/workflows/build-matrix-1.21.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.21+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.21, lex: 51.0.24, neo: 96-beta}, { mc: 1.21.1, lex: 52.0.2, neo: 4}, {mc: 1.21.3, lex: 53.0.7, neo: 11-beta}] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 21 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_21 - run: chmod +x gradlew - - name: Build - working-directory: ./1_21 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} -Pneoforge_version=${{ matrix.version.neo }} --stacktrace diff --git a/.github/workflows/build-matrix-1.7.yml b/.github/workflows/build-matrix-1.7.yml deleted file mode 100644 index 3aafc53..0000000 --- a/.github/workflows/build-matrix-1.7.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.7+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.7.10, lex: 10.13.4.1614-1.7.10} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_7_10 - run: chmod +x gradlew - - name: Build - working-directory: ./1_7_10 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-matrix-1.8.yml b/.github/workflows/build-matrix-1.8.yml deleted file mode 100644 index d4cd5a1..0000000 --- a/.github/workflows/build-matrix-1.8.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Matrix 1.8+ -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [ {mc: 1.8.9, lex: 11.15.1.2318-1.8.9} ] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./1_8_9 - run: chmod +x gradlew - - name: Build - working-directory: ./1_8_9 - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} --stacktrace diff --git a/.github/workflows/build-specific-reusable.yml b/.github/workflows/build-specific-reusable.yml deleted file mode 100644 index c4d4675..0000000 --- a/.github/workflows/build-specific-reusable.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Build specific version reusable -on: - workflow_call: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - type: string - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - type: string - lex: - description: 'The LexForge version to use' - required: true - default: '49.0.38' - type: string - neo: - description: 'The NeoForge version to use' - required: true - default: '219' - type: string - java: - description: 'The Java version to use' - required: true - default: '17' - type: string - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - type: string - upload: - description: 'Uploads the artifacts from the build' - required: false - default: 'true' - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java }} - distribution: ${{ inputs.java-distribution }} - - name: Grant execute permission for gradlew - working-directory: ./${{ inputs.dir }} - run: chmod +x gradlew - - name: Build - working-directory: ./${{ inputs.dir }} - run: ./gradlew build -Pminecraft_version=${{ inputs.mc }} -Plexforge_version=${{ inputs.lex }} -Pneoforge_version=${{ inputs.neo }} --stacktrace - - name: Upload ${{ matrix.version.mc }} Jars - if: ${{ inputs.upload == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: jars-${{ inputs.mc }} - path: ./${{ inputs.dir }}/build/libs/*.jar diff --git a/.github/workflows/build-specific.yml b/.github/workflows/build-specific.yml deleted file mode 100644 index a4c949e..0000000 --- a/.github/workflows/build-specific.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build specific version -on: - workflow_dispatch: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - lex: - description: 'The LexForge version to use' - required: true - default: '49.0.38' - neo: - description: 'The NeoForge version to use' - required: true - default: '219' - java: - description: 'The Java version to use' - required: true - default: '17' - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ github.event.inputs.java }} - distribution: ${{ github.event.inputs.java-distribution }} - - name: Grant execute permission for gradlew - working-directory: ./${{ github.event.inputs.dir }} - run: chmod +x gradlew - - name: Build - working-directory: ./${{ github.event.inputs.dir }} - run: ./gradlew build -Pminecraft_version=${{ github.event.inputs.mc }} -Plexforge_version=${{ github.event.inputs.lex }} -Pneoforge_version=${{ github.event.inputs.neo }} --stacktrace - - name: Publish jars - uses: actions/upload-artifact@v4 - with: - name: Artifacts - path: | - ./${{ github.event.inputs.dir }}/build/libs/*.jar diff --git a/.github/workflows/delete-old-workflows.yml b/.github/workflows/delete-old-workflows.yml deleted file mode 100644 index 2a4ea67..0000000 --- a/.github/workflows/delete-old-workflows.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Delete old workflow runs -on: - workflow_call: - workflow_dispatch: - inputs: - days: - description: 'Days-worth of runs to keep for each workflow' - required: true - default: '30' - minimum_runs: - description: 'Minimum runs to keep for each workflow' - required: true - default: '6' - delete_workflow_pattern: - description: 'Name or filename of the workflow (if not set, all workflows are targeted)' - required: false - delete_workflow_by_state_pattern: - description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' - required: true - default: "ALL" - type: choice - options: - - "ALL" - - active - - deleted - - disabled_inactivity - - disabled_manually - delete_run_by_conclusion_pattern: - description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success' - required: true - default: "ALL" - type: choice - options: - - "ALL" - - "Unsuccessful: action_required,cancelled,failure,skipped" - - action_required - - cancelled - - failure - - skipped - - success - dry_run: - description: 'Logs simulated changes, no deletions are performed' - required: false - -jobs: - del_runs: - runs-on: ubuntu-latest - permissions: - actions: write - contents: read - steps: - - name: Delete workflow runs - uses: Mattraks/delete-workflow-runs@v2 - with: - token: ${{ github.token }} - repository: ${{ github.repository }} - retain_days: ${{ github.event.inputs.days }} - keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} - delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} - delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} - delete_run_by_conclusion_pattern: >- - ${{ - startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:') - && 'action_required,cancelled,failure,skipped' - || github.event.inputs.delete_run_by_conclusion_pattern - }} - dry_run: ${{ github.event.inputs.dry_run }} diff --git a/.github/workflows/fabric.yml b/.github/workflows/fabric.yml deleted file mode 100644 index 3e2208e..0000000 --- a/.github/workflows/fabric.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Run Fabric 1.20.4 -on: - workflow_dispatch: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - id: setup-java-17 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - - name: Configure Dummy Assets - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - - name: Get HeadlessMC - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/2.4.1/headlessmc-launcher-2.4.1.jar - - name: Download 1.20.4 - run: java -jar headlessmc-launcher.jar --command download 1.20.4 - - name: Download Fabric 1.20.4 - run: java -jar headlessmc-launcher.jar --command fabric 1.20.4 - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - - name: Make mods dir - run: mkdir -p run/mods - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - - name: Build - run: ./gradlew build --stacktrace - - name: Copy mod - run: cp build/libs/mc-runtime-test-*-fabric-release.jar run/mods - - name: LS mods dir - run: ls run/mods - - name: Run game - run: java -jar headlessmc-launcher.jar --command launch fabric.*1.20.4 -regex -lwjgl --jvm -Djava.awt.headless=true diff --git a/.github/workflows/flex-build.yml b/.github/workflows/flex-build.yml new file mode 100644 index 0000000..1c1cdf6 --- /dev/null +++ b/.github/workflows/flex-build.yml @@ -0,0 +1,89 @@ +--- +name: Flex Build + +"on": + workflow_call: + inputs: + dir: + description: Directory to build + required: true + type: string + mc: + description: Minecraft version + type: string + lex: + description: LexForge version + type: string + neo: + description: NeoForge version + type: string + java: + description: Java version + required: true + type: string + upload: + description: Upload the build artifacts + default: true + type: boolean + publish: + description: Run Gradle publish + default: false + type: boolean + +jobs: + build: + name: Build ${{ inputs.dir }}/${{ inputs.mc }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + sparse-checkout: | + api + ${{ inputs.dir }} + + - name: Cache build + id: cache + uses: actions/cache@v4 + with: + path: ${{ inputs.dir }}/build + key: build-${{ hashFiles(format('{0}/[a-z]**', inputs.dir), 'api/**') }} + + - if: steps.cache.outputs.cache-hit != 'true' + name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ inputs.java }} + + - if: steps.cache.outputs.cache-hit != 'true' + name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - if: | + steps.cache.outputs.cache-hit != 'true' + && !inputs.release + name: Gradle build + run: > + ./gradlew build --stacktrace + -Pminecraft_version=${{ inputs.mc }} + -Plexforge_version=${{ inputs.lex }} + -Pneoforge_version=${{ inputs.neo }} + working-directory: ${{ inputs.dir }} + + - if: inputs.release + name: Gradle publish + env: + IS_MAVEN_PUB: true + DEPLOY_TO_GITHUB_PACKAGES_URL: https://maven.pkg.github.com/${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew publish + working-directory: ${{ inputs.dir }} + + - if: inputs.upload + name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: jars-${{ inputs.mc || inputs.dir }}${{ inputs.dir == 'gametest' && '-gametest' || '' }} + path: ${{ inputs.dir }}/build/libs/*.jar diff --git a/.github/workflows/publish-api.yml b/.github/workflows/publish-api.yml index 0700989..f4aa067 100644 --- a/.github/workflows/publish-api.yml +++ b/.github/workflows/publish-api.yml @@ -1,29 +1,16 @@ -name: Publish API to github packages +--- +name: Publish API -on: - workflow_dispatch: +"on": release: - types: [ created ] + types: [created] jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - name: Grant execute permission for gradlew - working-directory: ./api - run: chmod +x gradlew - - name: Publish with gradle - working-directory: ./api - env: - IS_MAVEN_PUB: true - DEPLOY_TO_GITHUB_PACKAGES_URL: https://maven.pkg.github.com/3arthqu4ke/mc-runtime-test - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ github.token }} - run: ./gradlew publish + publish-api: + name: Publish API + uses: ./.github/workflows/flex-build.yml + with: + dir: api + java: 8 + publish: true + upload: false diff --git a/.github/workflows/release-all.yml b/.github/workflows/release-all.yml deleted file mode 100644 index 696c337..0000000 --- a/.github/workflows/release-all.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Release - -on: - push: - tags: - - '**' - -jobs: - build: - strategy: - matrix: - version: - - { dir: api, mc: api, lex: api, neo: api, java: 8 } - - { dir: 1_21, mc: 1.21.3, lex: 53.0.7, neo: 11-beta, java: 21 } - - { dir: 1_21, mc: 1.21.1, lex: 52.0.2, neo: 4, java: 21 } - - { dir: 1_21, mc: 1.21, lex: 51.0.24, neo: 96-beta, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, lex: 50.1.10, neo: 119, java: 21 } - - { dir: 1_20, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } - - { dir: 1_20, mc: 1.20.3, lex: 49.0.2, neo: 8-beta, java: 17 } - - { dir: 1_20, mc: 1.20.2, lex: 48.1.0, neo: 88, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, lex: 47.2.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.4, lex: 45.2.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.3, lex: 44.1.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.2, lex: 43.3.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.1, lex: 42.0.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19, lex: 41.1.0, neo: 0, java: 17 } - - { dir: 1_18, mc: 1.18.2, lex: 40.2.18, neo: 0, java: 17 } - - { dir: 1_17, mc: 1.17.1, lex: 37.1.1, neo: 0, java: 16 } - - { dir: 1_16, mc: 1.16.5, lex: 36.2.42, neo: 0, java: 8 } - - { dir: 1_12, mc: 1.12.2, lex: 14.23.5.2860, neo: 0, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, lex: 11.15.1.2318-1.8.9, neo: 0, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, lex: 10.13.4.1614-1.7.10, neo: 0, java: 8 } - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.version.java }} - distribution: adopt - - name: Grant execute permission for gradlew - working-directory: ./${{ matrix.version.dir }} - run: chmod +x gradlew - - name: Build - working-directory: ./${{ matrix.version.dir }} - run: ./gradlew build -Pminecraft_version=${{ matrix.version.mc }} -Plexforge_version=${{ matrix.version.lex }} -Pneoforge_version=${{ matrix.version.neo }} --stacktrace - - name: Upload ${{ matrix.version.mc }} Jars - uses: actions/upload-artifact@v4 - with: - name: jars-${{ matrix.version.mc }} - path: ./${{ matrix.version.dir }}/build/libs/*.jar - - merge: - runs-on: ubuntu-latest - needs: build - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - delete-merged: true - - release: - runs-on: ubuntu-latest - needs: merge - steps: - - uses: actions/download-artifact@v4 - - name: Display structure of downloaded files - run: ls -R - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - generate_release_notes: true - files: | - ./merged-artifacts/*-release.jar - ./merged-artifacts/*-api*.jar diff --git a/.github/workflows/run-gametests-latest.yml b/.github/workflows/run-gametests-latest.yml deleted file mode 100644 index a7b50ce..0000000 --- a/.github/workflows/run-gametests-latest.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Run latest gametests -on: - workflow_dispatch: - workflow_call: - -jobs: - build-gametest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for gametest gradlew - working-directory: ./gametest - run: chmod +x gradlew - - name: Build Gametest - working-directory: ./gametest - run: ./gradlew build --stacktrace - - uses: actions/upload-artifact@v4 - with: - name: gametest-jars - path: ./gametest/build/libs/*.jar - - build-latest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: adopt - - name: Grant execute permission for latest gradlew - working-directory: ./1_20 - run: chmod +x gradlew - - name: Build latest - working-directory: ./1_20 - run: ./gradlew build --stacktrace - - uses: actions/upload-artifact@v4 - with: - name: latest-jars - path: ./1_20/build/libs/*.jar - - run: - needs: [build-gametest, build-latest] - strategy: - matrix: - version: - - { dir: 1_20, mc: 1.20.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_20, mc: 1.20.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_20, mc: 1.20.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 - - name: Make mods dir - run: mkdir -p run/mods - - name: Copy mod files - run: | - cp gametest-jars/clientgametest-1.20.6-2.4.2-fabric.jar run/mods - cp gametest-jars/clientgametest-1.20.6-2.4.2-neoforge.jar run/mods - cp gametest-jars/clientgametest-1.20.6-2.4.2-lexforge.jar run/mods - cp latest-jars/mc-runtime-test-1.20.6-2.4.2-fabric-release.jar run/mods - cp latest-jars/mc-runtime-test-1.20.6-2.4.2-lexforge-release.jar run/mods - cp latest-jars/mc-runtime-test-1.20.6-2.4.2-neoforge-release.jar run/mods - - name: Run game for version - id: local-action - uses: ./.github/actions/local-action - with: - mc-runtime-test: none - headlessmc-command: --jvm "-Djava.awt.headless=true -DMcRuntimeGameTestMinExpectedGameTests=1" - fabric-api: 0.97.0 - fabric-gametest-api: 1.3.5+85d85a934f - checkout: false diff --git a/.github/workflows/run-gametests.yml b/.github/workflows/run-gametests.yml new file mode 100644 index 0000000..f81d0b7 --- /dev/null +++ b/.github/workflows/run-gametests.yml @@ -0,0 +1,70 @@ +--- +name: Run gametests + +"on": + workflow_dispatch: + +jobs: + build: + name: Build + strategy: + matrix: + include: + - { dir: gametest, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } + - { dir: 1_20, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } + uses: ./.github/workflows/flex-build.yml + with: + dir: ${{ matrix.dir }} + mc: ${{ matrix.mc }} + lex: ${{ matrix.lex }} + neo: ${{ matrix.neo }} + java: ${{ matrix.java }} + + merge: + name: Merge + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Merge artifacts + uses: actions/upload-artifact/merge@v4 + with: + delete-merged: true + + run: + name: Run tests + needs: [merge] + strategy: + matrix: + include: + - { mc: 1.20.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.20.4, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } + - { mc: 1.20.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + runs-on: ubuntu-22.04 + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Stage artifacts + run: | + mkdir -p run/mods + cp merged-artifacts/clientgametest-${{ matrix.mc }}-*-${{ matrix.type }}.jar run/mods + cp merged-artifacts/mc-runtime-test-${{ matrix.mc }}-*-${{ matrix.type }}-release.jar run/mods + + - name: Setup temurin-${{ matrix.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: temurin + + - name: Run game + timeout-minutes: 3 + uses: ./ + with: + mc: ${{ matrix.mc }} + modloader: ${{ matrix.modloader }} + regex: ${{ matrix.regex }} + java: ${{ matrix.java }} + mc-runtime-test: none + headlessmc-command: --jvm "-Djava.awt.headless=true -DMcRuntimeGameTestMinExpectedGameTests=1" + fabric-api: 0.97.0 + fabric-gametest-api: 1.3.5+85d85a934f diff --git a/.github/workflows/run-latest.yml b/.github/workflows/run-latest.yml deleted file mode 100644 index 32a845b..0000000 --- a/.github/workflows/run-latest.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Run latest version -on: - workflow_dispatch: - workflow_call: - -jobs: - run: - strategy: - matrix: - version: - - { dir: 1_20/1_20_6, mc: 1.20.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/run-specific-reusable.yml@main - with: - dir: ${{ matrix.version.dir }} - mc: ${{ matrix.version.mc }} - type: ${{ matrix.version.type }} - modloader: ${{ matrix.version.modloader }} - regex: ${{ matrix.version.regex }} - java: ${{ matrix.version.java }} diff --git a/.github/workflows/run-local-test.yml b/.github/workflows/run-local-test.yml new file mode 100644 index 0000000..948ff1d --- /dev/null +++ b/.github/workflows/run-local-test.yml @@ -0,0 +1,35 @@ +--- +name: Run local test + +"on": + workflow_dispatch: + +env: + java_version: 21 + +jobs: + run: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup temurin-${{ env.java_version }} + uses: actions/setup-java@v4 + with: + java-version: ${{ env.java_version }} + distribution: temurin + + - name: Run game + timeout-minutes: 3 + uses: ./ + with: + mc: 1.20.4 + modloader: fabric + regex: .*fabric.* + mc-runtime-test: fabric + java: ${{ env.java_version }} + fabric-api: 0.97.0 + fabric-gametest-api: 1.3.5+85d85a934f diff --git a/.github/workflows/run-matrix-with-hmc.yml b/.github/workflows/run-matrix-with-hmc.yml deleted file mode 100644 index 64bf644..0000000 --- a/.github/workflows/run-matrix-with-hmc.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Run all versions with HMC -lwjgl -on: - workflow_dispatch: - workflow_call: - -jobs: - run: - strategy: - matrix: - version: - - { dir: 1_21, mc: 1.21.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_20, mc: 1.20.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.4, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_18, mc: 1.18.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_18, mc: 1.18.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_17, mc: 1.17.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 16 } - - { dir: 1_17, mc: 1.17.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 16 } - - { dir: 1_16, mc: 1.16.5, type: fabric, modloader: fabric, regex: .*fabric.*, java: 8 } - - { dir: 1_16, mc: 1.16.5, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } - - { dir: 1_12, mc: 1.12.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/run-specific-reusable.yml@main - with: - dir: ${{ matrix.version.dir }} - mc: ${{ matrix.version.mc }} - type: ${{ matrix.version.type }} - modloader: ${{ matrix.version.modloader }} - regex: ${{ matrix.version.regex }} - java: ${{ matrix.version.java }} - xvfb: false - headlessmc-command: -lwjgl --retries 3 --jvm -Djava.awt.headless=true diff --git a/.github/workflows/run-matrix.yml b/.github/workflows/run-matrix.yml index 2a05e88..1e6fe7f 100644 --- a/.github/workflows/run-matrix.yml +++ b/.github/workflows/run-matrix.yml @@ -1,16 +1,22 @@ -name: Run all versions -on: +--- +name: Build, Test, and Release + +"on": push: + tags: + - '**' + branches: + - main pull_request: workflow_dispatch: - workflow_call: jobs: build: + name: Build strategy: matrix: - version: - - { dir: api, mc: api, lex: api, neo: api, java: 8 } + include: + - { dir: api, java: 8 } - { dir: 1_21, mc: 1.21.3, lex: 53.0.7, neo: 11-beta, java: 21 } - { dir: 1_21, mc: 1.21.1, lex: 52.0.2, neo: 4, java: 21 } - { dir: 1_21, mc: 1.21, lex: 51.0.24, neo: 96-beta, java: 21 } @@ -18,81 +24,146 @@ jobs: - { dir: 1_20, mc: 1.20.4, lex: 49.0.38, neo: 219, java: 17 } - { dir: 1_20, mc: 1.20.3, lex: 49.0.2, neo: 8-beta, java: 17 } - { dir: 1_20, mc: 1.20.2, lex: 48.1.0, neo: 88, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, lex: 47.2.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.4, lex: 45.2.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.3, lex: 44.1.23, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.2, lex: 43.3.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19.1, lex: 42.0.9, neo: 0, java: 17 } - - { dir: 1_19, mc: 1.19, lex: 41.1.0, neo: 0, java: 17 } - - { dir: 1_18, mc: 1.18.2, lex: 40.2.18, neo: 0, java: 17 } - - { dir: 1_17, mc: 1.17.1, lex: 37.1.1, neo: 0, java: 16 } - - { dir: 1_16, mc: 1.16.5, lex: 36.2.42, neo: 0, java: 8 } - - { dir: 1_12, mc: 1.12.2, lex: 14.23.5.2860, neo: 0, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, lex: 11.15.1.2318-1.8.9, neo: 0, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, lex: 10.13.4.1614-1.7.10, neo: 0, java: 8 } - fail-fast: false - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/build-specific-reusable.yml@main + - { dir: 1_20/1_20_1, mc: 1.20.1, lex: 47.2.23, java: 17 } + - { dir: 1_19, mc: 1.19.4, lex: 45.2.9, java: 17 } + - { dir: 1_19, mc: 1.19.3, lex: 44.1.23, java: 17 } + - { dir: 1_19, mc: 1.19.2, lex: 43.3.9, java: 17 } + - { dir: 1_19, mc: 1.19.1, lex: 42.0.9, java: 17 } + - { dir: 1_19, mc: 1.19, lex: 41.1.0, java: 17 } + - { dir: 1_18, mc: 1.18.2, lex: 40.2.18, java: 17 } + - { dir: 1_17, mc: 1.17.1, lex: 37.1.1, java: 16 } + - { dir: 1_16, mc: 1.16.5, lex: 36.2.42, java: 8 } + - { dir: 1_12, mc: 1.12.2, lex: 14.23.5.2860, java: 8 } + - { dir: 1_8_9, mc: 1.8.9, lex: 11.15.1.2318-1.8.9, java: 8 } + - { dir: 1_7_10, mc: 1.7.10, lex: 10.13.4.1614-1.7.10, java: 8 } + uses: ./.github/workflows/flex-build.yml with: - dir: ${{ matrix.version.dir }} - mc: ${{ matrix.version.mc }} - lex: ${{ matrix.version.lex }} - neo: ${{ matrix.version.neo }} - java: ${{ matrix.version.java }} + dir: ${{ matrix.dir }} + mc: ${{ matrix.mc }} + lex: ${{ matrix.lex }} + neo: ${{ matrix.neo }} + java: ${{ matrix.java }} run: + if: | + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + name: Run tests needs: build + runs-on: ubuntu-22.04 strategy: matrix: + xvfb: [true, false] version: - - { dir: 1_21, mc: 1.21.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_21, mc: 1.21, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } - - { dir: 1_20/1_20_6, mc: 1.20.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } - - { dir: 1_20, mc: 1.20.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.4, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } - - { dir: 1_20, mc: 1.20.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_20/1_20_1, mc: 1.20.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_19, mc: 1.19, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_19, mc: 1.19, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_18, mc: 1.18.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } - - { dir: 1_18, mc: 1.18.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } - - { dir: 1_17, mc: 1.17.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 16 } - - { dir: 1_17, mc: 1.17.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 16 } - - { dir: 1_16, mc: 1.16.5, type: fabric, modloader: fabric, regex: .*fabric.*, java: 8 } - - { dir: 1_16, mc: 1.16.5, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } - - { dir: 1_12, mc: 1.12.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } - - { dir: 1_8_9, mc: 1.8.9, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } - - { dir: 1_7_10, mc: 1.7.10, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } - uses: 3arthqu4ke/mc-runtime-test/.github/workflows/run-specific-with-download-artifact-reusable.yml@main - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name - with: - dir: ${{ matrix.version.dir }} - mc: ${{ matrix.version.mc }} - type: ${{ matrix.version.type }} - modloader: ${{ matrix.version.modloader }} - regex: ${{ matrix.version.regex }} - java: ${{ matrix.version.java }} - headlessmc-command: '--retries 3 --jvm -Djava.awt.headless=true' + - { mc: 1.21.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } + - { mc: 1.21.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } + - { mc: 1.21.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } + - { mc: 1.21.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } + - { mc: 1.21.1, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } + - { mc: 1.21.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } + - { mc: 1.21, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } + - { mc: 1.21, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } + - { mc: 1.21, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } + - { mc: 1.20.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 } + - { mc: 1.20.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 } + - { mc: 1.20.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 } + - { mc: 1.20.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.20.4, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } + - { mc: 1.20.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.20.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.20.3, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } + - { mc: 1.20.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.20.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.20.2, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 17 } + - { mc: 1.20.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.20.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.20.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19.4, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19.4, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.19.3, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19.3, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.19.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.19.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.19, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.19, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.18.2, type: fabric, modloader: fabric, regex: .*fabric.*, java: 17 } + - { mc: 1.18.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 17 } + - { mc: 1.17.1, type: fabric, modloader: fabric, regex: .*fabric.*, java: 16 } + - { mc: 1.17.1, type: lexforge, modloader: forge, regex: .*forge.*, java: 16 } + - { mc: 1.16.5, type: fabric, modloader: fabric, regex: .*fabric.*, java: 8 } + - { mc: 1.16.5, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } + - { mc: 1.12.2, type: lexforge, modloader: forge, regex: .*forge.*, java: 8 } + - { mc: 1.8.9, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } + - { mc: 1.7.10, type: lexforge, modloader: forge, regex: .*orge.*, java: 8 } + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: jars-${{ matrix.version.mc }} + + - name: Bootstrap mods + run: | + mkdir -p run/mods + cp mc-runtime-test-*-${{ matrix.version.type }}-release.jar run/mods + + - name: Setup Java temurin-${{ matrix.version.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.version.java }} + distribution: temurin + + - name: Run game + timeout-minutes: 3 + uses: ./ + with: + mc: ${{ matrix.version.mc }} + mc-runtime-test: none + modloader: ${{ matrix.version.modloader }} + regex: ${{ matrix.version.regex }} + java: ${{ matrix.version.java }} + xvfb: ${{ matrix.xvfb }} + headlessmc-command: ${{ matrix.xvfb && '-lwjgl' || '' }} --retries 3 --jvm -Djava.awt.headless=true + + release: + if: startsWith(github.ref, 'refs/tags/') + needs: [run] + name: Release + permissions: + contents: write + runs-on: ubuntu-22.04 + steps: + - name: Merge artifacts + uses: actions/upload-artifact/merge@v4 + with: + delete-merged: true + + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: | + merged-artifacts/*-release.jar + merged-artifacts/*-api*.jar + + clean: + name: Clean up + needs: [run, release] + runs-on: ubuntu-22.04 + if: always() + steps: + - name: Delete artifacts + uses: geekyeggo/delete-artifact@v5.1.0 + with: + name: | + jars-* + failOnError: false diff --git a/.github/workflows/run-specific-reusable.yml b/.github/workflows/run-specific-reusable.yml deleted file mode 100644 index 64d520d..0000000 --- a/.github/workflows/run-specific-reusable.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: Run MC Reusable -on: - workflow_call: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - type: string - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - type: string - type: - description: 'The type to of jar to use (lexforge, neoforge or fabric)' - required: true - default: 'lexforge' - type: string - modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' - required: true - default: 'forge' - type: string - regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' - required: true - default: 'fabric.*1.20.4' - type: string - java: - description: 'The Java version to use' - required: true - default: '17' - type: string - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - type: string - xvfb: - description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' - required: false - default: 'true' - type: string - headlessmc-command: - description: 'Arguments for the headlessmc command.' - required: false - default: '--jvm -Djava.awt.headless=true' - type: string - download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' - required: false - default: 'true' - type: string - hmc-version: - description: 'The version of headlessmc to download.' - required: false - default: '2.4.1' - type: string - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java }} - distribution: ${{ inputs.java-distribution }} - cache: gradle - - name: Grant execute permission for gradlew - working-directory: ./${{ inputs.dir }} - run: chmod +x gradlew - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - - name: Configure Dummy Assets - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - - name: Get HeadlessMC - if: ${{ inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ inputs.hmc-version }}/headlessmc-launcher-${{ inputs.hmc-version }}.jar - - name: Download ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ inputs.mc }} - - name: Download ${{ inputs.modloader }} ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ inputs.modloader }} ${{ inputs.mc }} --java ${{ inputs.java }} - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - - name: Make mods dir - run: mkdir -p run/mods - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - - name: Build - working-directory: ./${{ inputs.dir }} - run: ./gradlew build --stacktrace - - name: Copy mod - run: cp ${{ inputs.dir }}/build/libs/mc-runtime-test-*-${{ inputs.type }}-release.jar run/mods - - name: LS mods dir - run: ls run/mods - - name: Install xrandr - if: ${{ inputs.xvfb == 'true' }} - run: sudo apt install x11-xserver-utils - shell: bash - - name: Run game with xvfb - if: ${{ inputs.xvfb == 'true' }} - run: xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash - - name: Run game - if: ${{ inputs.xvfb != 'true' }} - run: java -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash diff --git a/.github/workflows/run-specific-with-download-artifact-reusable.yml b/.github/workflows/run-specific-with-download-artifact-reusable.yml deleted file mode 100644 index 9e71d74..0000000 --- a/.github/workflows/run-specific-with-download-artifact-reusable.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Run MC Reusable with download artifact -on: - workflow_call: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - type: string - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - type: string - type: - description: 'The type to of jar to use (lexforge, neoforge or fabric)' - required: true - default: 'lexforge' - type: string - modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' - required: true - default: 'forge' - type: string - regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' - required: true - default: 'fabric.*1.20.4' - type: string - java: - description: 'The Java version to use' - required: true - default: '17' - type: string - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - type: string - xvfb: - description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' - required: false - default: 'true' - type: string - headlessmc-command: - description: 'Arguments for the headlessmc command.' - required: false - default: '--jvm -Djava.awt.headless=true' - type: string - download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' - required: false - default: 'true' - type: string - hmc-version: - description: 'The version of headlessmc to download.' - required: false - default: '2.4.1' - type: string - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java }} - distribution: ${{ inputs.java-distribution }} - cache: gradle - - name: Grant execute permission for gradlew - working-directory: ./${{ inputs.dir }} - run: chmod +x gradlew - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - - name: Configure Dummy Assets - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - - name: Get HeadlessMC - if: ${{ inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ inputs.hmc-version }}/headlessmc-launcher-${{ inputs.hmc-version }}.jar - - name: Download ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ inputs.mc }} - - name: Download ${{ inputs.modloader }} ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ inputs.modloader }} ${{ inputs.mc }} --java ${{ inputs.java }} - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - - name: Make mods dir - run: mkdir -p run/mods - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - - uses: actions/download-artifact@v4 - name: jars-${{ inputs.mc }} - - name: Copy mod - run: cp jars-${{ inputs.mc }}/mc-runtime-test-*-${{ inputs.type }}-release.jar run/mods - - name: LS mods dir - run: ls run/mods - - name: Install xrandr - if: ${{ inputs.xvfb == 'true' }} - run: sudo apt install x11-xserver-utils - shell: bash - - name: Run game with xvfb - if: ${{ inputs.xvfb == 'true' }} - run: xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash - - name: Run game - if: ${{ inputs.xvfb != 'true' }} - run: java -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} - shell: bash diff --git a/.github/workflows/run-specific-xvfb.yml b/.github/workflows/run-specific-xvfb.yml deleted file mode 100644 index 97342eb..0000000 --- a/.github/workflows/run-specific-xvfb.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Run MC with Xvfb -on: - workflow_dispatch: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - type: - description: 'The type to of jar to use (lexforge, neoforge or fabric)' - required: true - default: 'lexforge' - modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' - required: true - default: 'forge' - regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' - required: true - default: 'fabric.*1.20.4' - java: - description: 'The Java version to use' - required: true - default: '17' - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - headlessmc-command: - description: 'Arguments for the headlessmc command.' - required: false - default: '--jvm -Djava.awt.headless=true' - type: string - download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' - required: false - default: 'true' - type: string - hmc-version: - description: 'The version of headlessmc to download.' - required: false - default: '2.4.1' - type: string - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ github.event.inputs.java }} - distribution: ${{ github.event.inputs.java-distribution }} - - name: Grant execute permission for gradlew - working-directory: ./${{ github.event.inputs.dir }} - run: chmod +x gradlew - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - - name: Configure Dummy Assets - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - - name: Get HeadlessMC - if: ${{ github.event.inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ github.event.inputs.hmc-version }}/headlessmc-launcher-${{ github.event.inputs.hmc-version }}.jar - - name: Download ${{ github.event.inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ github.event.inputs.mc }} - - name: Download ${{ github.event.inputs.modloader }} ${{ github.event.inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ github.event.inputs.modloader }} ${{ github.event.inputs.mc }} --java ${{ github.event.inputs.java }} - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - - name: Make mods dir - run: mkdir -p run/mods - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - - name: Build - working-directory: ./${{ github.event.inputs.dir }} - run: ./gradlew build --stacktrace - - name: Copy mod - run: cp ${{ github.event.inputs.dir }}/build/libs/mc-runtime-test-*-${{ github.event.inputs.type }}-release.jar run/mods - - name: LS mods dir - run: ls run/mods - - name: Install xrandr - run: sudo apt install x11-xserver-utils - shell: bash - - name: Run game with xvfb - run: xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher.jar --command launch ${{ github.event.inputs.regex }} -regex ${{ github.event.inputs.headlessmc-command }} - shell: bash diff --git a/.github/workflows/run-specific.yml b/.github/workflows/run-specific.yml deleted file mode 100644 index 788d588..0000000 --- a/.github/workflows/run-specific.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Run MC with lwjgl -on: - workflow_dispatch: - inputs: - dir: - description: 'The directory to build in' - required: true - default: '1_20' - mc: - description: 'The MC version to build' - required: true - default: '1.20.4' - type: - description: 'The type to of jar to use (lexforge, neoforge or fabric)' - required: true - default: 'lexforge' - modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' - required: true - default: 'forge' - regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' - required: true - default: 'fabric.*1.20.4' - java: - description: 'The Java version to use' - required: true - default: '17' - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' - headlessmc-command: - description: 'Arguments for the headlessmc command.' - required: false - default: '-lwjgl --jvm -Djava.awt.headless=true' - type: string - download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' - required: false - default: 'true' - type: string - hmc-version: - description: 'The version of headlessmc to download.' - required: false - default: '2.4.1' - type: string - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: ${{ github.event.inputs.java }} - distribution: ${{ github.event.inputs.java-distribution }} - - name: Grant execute permission for gradlew - working-directory: ./${{ github.event.inputs.dir }} - run: chmod +x gradlew - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties - - name: Configure Dummy Assets - run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties - - name: Get HeadlessMC - if: ${{ github.event.inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ github.event.inputs.hmc-version }}/headlessmc-launcher-${{ github.event.inputs.hmc-version }}.jar - - name: Download ${{ github.event.inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ github.event.inputs.mc }} - - name: Download ${{ github.event.inputs.modloader }} ${{ github.event.inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ github.event.inputs.modloader }} ${{ github.event.inputs.mc }} --java ${{ github.event.inputs.java }} - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - - name: Make mods dir - run: mkdir -p run/mods - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt - - name: Build - working-directory: ./${{ github.event.inputs.dir }} - run: ./gradlew build --stacktrace - - name: Copy mod - run: cp ${{ github.event.inputs.dir }}/build/libs/mc-runtime-test-*-${{ github.event.inputs.type }}-release.jar run/mods - - name: LS mods dir - run: ls run/mods - - name: Run game - run: java -jar headlessmc-launcher.jar --command launch ${{ github.event.inputs.regex }} -regex ${{ github.event.inputs.headlessmc-command }} - shell: bash - diff --git a/.github/workflows/run-test-with-action.yml b/.github/workflows/run-test-with-action.yml deleted file mode 100644 index 60954f8..0000000 --- a/.github/workflows/run-test-with-action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Test the run action -on: - workflow_dispatch: - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Local Action Call - id: local-action - uses: ./.github/actions/local-action diff --git a/.github/workflows/verify-wrapper.yml b/.github/workflows/verify-wrapper.yml deleted file mode 100644 index 290244d..0000000 --- a/.github/workflows/verify-wrapper.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Validate Gradle Wrapper" - -on: - push: - pull_request: - workflow_dispatch: - workflow_call: - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v2 - diff --git a/1_12/gradlew b/1_12/gradlew old mode 100644 new mode 100755 diff --git a/1_16/gradlew b/1_16/gradlew old mode 100644 new mode 100755 diff --git a/1_17/gradlew b/1_17/gradlew old mode 100644 new mode 100755 diff --git a/1_18/gradlew b/1_18/gradlew old mode 100644 new mode 100755 diff --git a/1_19/gradlew b/1_19/gradlew old mode 100644 new mode 100755 diff --git a/1_20/1_20_1/gradlew b/1_20/1_20_1/gradlew old mode 100644 new mode 100755 diff --git a/1_20/1_20_6/gradlew b/1_20/1_20_6/gradlew old mode 100644 new mode 100755 diff --git a/1_20/gradlew b/1_20/gradlew old mode 100644 new mode 100755 diff --git a/1_21/gradlew b/1_21/gradlew old mode 100644 new mode 100755 diff --git a/1_7_10/gradlew b/1_7_10/gradlew old mode 100644 new mode 100755 diff --git a/1_8_9/gradlew b/1_8_9/gradlew old mode 100644 new mode 100755 diff --git a/README.md b/README.md index 2141e40..a5b1a72 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -

Mc-Runtime-Test

+

MC-Runtime-Test

Run the Minecraft client inside your CI/CD pipeline.

-

Mc-Runtime-Test | HMC | HMC-Specifics | HMC-Optimizations

+

MC-Runtime-Test | HMC | HMC-Specifics | HMC-Optimizations

@@ -31,7 +31,7 @@ This way you can already run simple boot tests, checking whether the game will b Mods for newer versions also execute all [gametests](https://www.minecraft.net/en-us/creator/article/get-started-gametest-framework) registered. -Mc-Runtime-Test currently supports the following Minecraft versions and modloaders: +MC-Runtime-Test currently supports the following Minecraft versions and modloaders: You can configure it to use any other version, but in that case you need to set `mc-runtime-test` to `none` and provide another way for the game to exit, or the workflow will run indefinitely.
@@ -59,11 +59,19 @@ name: Run the MC client on: workflow_dispatch: +env: + java_version: 21 + jobs: run: runs-on: ubuntu-latest steps: - # ... run actions to build your client + - name: Install Java + uses: actions/setup-java@v4 + with: + java-version: ${{ env.java_version }} + distribution: "temurin" + # ... run actions to build your mod # Copy the jar that you build to the mods folder - name: Copy mod jar to mods run: mkdir -p run/mods && cp build/libs/.jar run/mods @@ -75,7 +83,7 @@ jobs: modloader: fabric regex: .*fabric.* mc-runtime-test: fabric - java: 17 + java: ${{ env.java_version }} ``` An example workflow in action can be found [here](https://github.com/3arthqu4ke/hmc-optimizations/blob/1.20.4/.github/workflows/run-fabric.yml). @@ -89,7 +97,6 @@ at once can be found - `modloader`: The modloader to install with HeadlessMC (`forge`, `neoforge` or `fabric`). - `regex`: A Regex to match the MC version to launch (can in most cases just be `.*.*`, like `.*fabric.*`, very old versions of forge might start with an uppercase `Forge`). - `java`: The Java version to use, e.g. `17`. -- `java-distribution`: The [Java distribution](https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions) to use, by default we use the adopt distribution. - `dummy-assets`: HeadlessMC will use dummy assets to not download all the MC assets. Can be disabled by setting this to `false`. - `mc-runtime-test`: The MC-Runtime-Test jar to download (`none`, `lexforge`, `fabric` or `neoforge`). When using `none` you need to provide a way for the game to exit or the action will run indefinitely and time out. - `xvfb`: If `true` (default), runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc. @@ -101,8 +108,7 @@ at once can be found # Running your own tests MC-Runtime-Test does not provide a framework for full integration tests. -You can, however, -use Minecrafts own [Game-Test Framework](https://www.minecraft.net/en-us/creator/article/get-started-gametest-framework). +You can, however, use Minecrafts own [Game-Test Framework](https://www.minecraft.net/en-us/creator/article/get-started-gametest-framework). MC-Runtime-Test will basically execute the `/test runall` command after joining the world. On Neoforge/Lexforge gametest discovery does really not work in production, you might need to register them themselves and use other [hacks](gametest/src/main/java/me/earth/clientgametest/mixin/MixinGameTestRegistry.java) diff --git a/action.yml b/action.yml index f453e95..190a99e 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: 'Mc-Runtime-Test' -description: 'Runs the MC client inside your CI.' +name: MC-Runtime-Test +description: Runs the MC client inside your CI author: 3arthqu4ke branding: icon: play @@ -7,133 +7,140 @@ branding: inputs: mc: - description: 'The MC version to run' + description: Minecraft version to run required: true - default: '1.20.4' + default: "1.20.4" modloader: - description: 'The modloader to install with HeadlessMc (forge, neoforge or fabric)' + description: Modloader to install (forge, neoforge, fabric) required: true - default: 'fabric' + default: "fabric" regex: - description: 'Regex to match the MC version to launch (forge is like 1.20.4-forge and fabric starts with fabric-1.20)' + description: Regex to match the modloader jar required: true - default: '.*fabric.*' + default: ".*fabric.*" java: - description: 'The Java version to use' + description: Java version to use required: true - default: '17' - java-distribution: - description: 'The Java distribution to use' - required: false - default: 'adopt' + default: "17" dummy-assets: - description: 'Whether to use Dummy Assets or not' + description: Use dummy assets during testing required: true - default: 'true' + default: "true" mc-runtime-test: - description: 'The mc-runtime-test jar to download (none, lexforge, fabric or neoforge)' + description: MC-Runtime-Test jar to download (none, lexforge, neoforge, fabric) required: true - default: 'fabric' + default: "fabric" xvfb: - description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' + description: Runs the game with Xvfb (if false, add the -lwjgl argument) required: false - default: 'true' + default: "true" headlessmc-command: - description: 'Arguments for the headlessmc command.' + description: Command-line arguments for HeadlessMC required: false - default: '--jvm -Djava.awt.headless=true' + default: "--jvm -Djava.awt.headless=true" fabric-api: - description: 'Downloads the Fabric-API from https://maven.fabricmc.net/. Supply the version (e.g. 0.97.0, or none)' + description: Fabric API version to download (e.g. 0.97.0) or none required: false - default: 'none' + default: "none" fabric-gametest-api: - description: 'Downloads the Fabric-GameTest-API from https://maven.fabricmc.net/. Supply the version (e.g. 1.3.5+85d85a934f, or none)' + description: Fabric GameTest API version (e.g. 1.3.5+85d85a934f) or none required: false - default: 'none' + default: "none" download-hmc: - description: 'Whether to download headlessmc or not, if not you need to provide a file called headlessmc-launcher.jar.' + description: Download HeadlessMC required: false - default: 'true' + default: "true" hmc-version: - description: 'The version of headlessmc to download.' + description: HeadlessMC version + required: false + default: "2.4.1" + cache-mc: + description: Cache .minecraft required: false - default: '2.4.1' + default: "true" runs: - using: "composite" + using: composite steps: - - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.java }} - distribution: ${{ inputs.java-distribution }} - - name: Setup HeadlessMC directory - run: mkdir HeadlessMC - shell: bash - - name: Configure HeadlessMC java versions - run: echo hmc.java.versions=$JAVA_HOME/bin/java > HeadlessMC/config.properties - shell: bash - - name: Configure HeadlessMC game directory - run: echo hmc.gamedir=$PWD/run >> HeadlessMC/config.properties - shell: bash - - name: Configure offline mode - run: echo hmc.offline=true >> HeadlessMC/config.properties - shell: bash - - name: Configure Exceptions - run: echo hmc.rethrow.launch.exceptions=true >> HeadlessMC/config.properties - shell: bash - - name: Configure Failing on wrong command - run: echo hmc.exit.on.failed.command=true >> HeadlessMC/config.properties + - name: Bootstrap HeadlessMC + run: | + mkdir -p HeadlessMC run/mods + cat <> HeadlessMC/config.properties + hmc.java.versions=$JAVA_HOME/bin/java + hmc.gamedir=$PWD/run + hmc.offline=true + hmc.rethrow.launch.exceptions=true + hmc.exit.on.failed.command=true + EOF shell: bash - - name: Configure Dummy Assets - if: ${{ inputs.dummy-assets == 'true' }} + + - if: inputs.dummy-assets == 'true' + name: Configure Dummy Assets run: echo hmc.assets.dummy=true >> HeadlessMC/config.properties shell: bash - - name: Get HeadlessMC - if: ${{ inputs.download-hmc == 'true' }} - run: wget -O headlessmc-launcher.jar https://github.com/3arthqu4ke/headlessmc/releases/download/${{ inputs.hmc-version }}/headlessmc-launcher-${{ inputs.hmc-version }}.jar - shell: bash - - name: Download ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command download ${{ inputs.mc }} - shell: bash - - name: Download Fabric ${{ inputs.mc }} - run: java -jar headlessmc-launcher.jar --command ${{ inputs.modloader }} ${{ inputs.mc }} --java ${{ inputs.java }} - shell: bash - - name: List versions - run: java -jar headlessmc-launcher.jar --command versions - shell: bash - - name: Make mods dir - run: mkdir -p run/mods - shell: bash - - name: Download mc-runtime-test jar ${{ inputs.mc-runtime-test }} - if: ${{ inputs.mc-runtime-test != 'none' }} - run: wget -O run/mods/mc-runtime-test-${{ inputs.mc }}-2.4.2-${{ inputs.mc-runtime-test }}-release.jar https://github.com/3arthqu4ke/mc-runtime-test/releases/download/2.4.2/mc-runtime-test-${{ inputs.mc }}-2.4.2-${{ inputs.mc-runtime-test }}-release.jar - shell: bash - - name: Download fabric-api jar ${{ inputs.fabric-api }} - if: ${{ inputs.fabric-api != 'none' }} - run: wget -O run/mods/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/${{ inputs.fabric-api }}+${{ inputs.mc }}/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar - shell: bash - - name: Download fabric-gametest-api jar ${{ inputs.fabric-gametest-api }} - if: ${{ inputs.fabric-gametest-api != 'none' }} - run: wget -O run/mods/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-gametest-api-v1/${{ inputs.fabric-gametest-api }}/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar - shell: bash - - name: Configure Accessibility - run: echo onboardAccessibility:false >> run/options.txt + + - if: inputs.download-hmc == 'true' + name: Get HeadlessMC + uses: robinraju/release-downloader@v1.11 + with: + repository: 3arthqu4ke/headlessmc + tag: ${{ inputs.hmc-version }} + fileName: headlessmc-launcher-${{ inputs.hmc-version }}.jar + + - if: inputs.cache-mc == 'true' + name: Cache Minecraft + uses: actions/cache@v4 + with: + path: /home/runner/.minecraft + key: hmc-${{ inputs.modloader }}-${{ inputs.mc }} + + - name: Download ${{ inputs.modloader }}-${{ inputs.mc }} + run: | + if [ ! -f "$HOME/.minecraft/versions/${{ inputs.mc }}/${{ inputs.mc }}.json" ]; then + java -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command download ${{ inputs.mc }} + java -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command ${{ inputs.modloader }} ${{ inputs.mc }} --java ${{ inputs.java }} + fi shell: bash - - name: Configure pauseOnLostFocus - run: echo pauseOnLostFocus:false >> run/options.txt + + - if: inputs.mc-runtime-test != 'none' + name: Get mc-runtime-test + uses: robinraju/release-downloader@v1.11 + with: + repository: 3arthqu4ke/mc-runtime-test + tag: "2.4.2" + fileName: mc-runtime-test-${{ inputs.mc }}-2.4.2-${{ inputs.mc-runtime-test }}-release.jar + out-file-path: run/mods + + - if: inputs.fabric-api != 'none' + name: Download fabric-api v${{ inputs.fabric-api }} + run: > + wget -O run/mods/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar + https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/${{ inputs.fabric-api }}+${{ inputs.mc }}/fabric-api-${{ inputs.fabric-api }}+${{ inputs.mc }}.jar shell: bash - - name: LS mods dir - run: ls run/mods + + - if: inputs.fabric-gametest-api != 'none' + name: Download fabric-gametest-api v${{ inputs.fabric-gametest-api }} + run: > + wget -O run/mods/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar + https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-gametest-api-v1/${{ inputs.fabric-gametest-api }}/fabric-gametest-api-v1-${{ inputs.fabric-gametest-api }}.jar shell: bash - - name: Install xrandr - if: ${{ inputs.xvfb == 'true' }} - run: sudo apt install x11-xserver-utils + + - name: Configure game + run: | + cat <> run/options.txt + onboardAccessibility:false + pauseOnLostFocus:false + EOF shell: bash - - name: Run game with xvfb - if: ${{ inputs.xvfb == 'true' }} - run: xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} + + - if: inputs.xvfb == 'true' + name: Run game with xvfb + run: | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y x11-xserver-utils + xvfb-run java -Dhmc.check.xvfb=true -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} shell: bash - - name: Run game - if: ${{ inputs.xvfb != 'true' }} - run: java -jar headlessmc-launcher.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} + + - if: inputs.xvfb != 'true' + name: Run game + run: java -jar headlessmc-launcher-${{ inputs.hmc-version }}.jar --command launch ${{ inputs.regex }} -regex ${{ inputs.headlessmc-command }} shell: bash diff --git a/api/build.gradle b/api/build.gradle index f476022..74fd324 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -37,7 +37,7 @@ afterEvaluate { name = 'GithubPagesMaven' url = System.getenv('DEPLOY_TO_GITHUB_PACKAGES_URL') credentials { - username = System.getenv('GITHUB_USER') + username = System.getenv('GITHUB_ACTOR') password = System.getenv('GITHUB_TOKEN') } } diff --git a/api/gradlew b/api/gradlew old mode 100644 new mode 100755 diff --git a/gametest/gradlew b/gametest/gradlew old mode 100644 new mode 100755 diff --git a/snapshots/gradlew b/snapshots/gradlew old mode 100644 new mode 100755