diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..637597a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,223 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Build Polychat Clients + +on: + workflow_dispatch: + inputs: + version: + #If we specify a version, that can work out nicely. + description: 'Polychat version to build' + required: true + + + +jobs: + + common: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build Common + run: | + cd core + ./gradlew -Pversion=${{ inputs.version }} :common:build + + - name: Upload Common + uses: actions/upload-artifact@v4 + with: + name: common-${{ inputs.version }}.jar + path: core/common/build/libs/common-${{ inputs.version }}.jar + + message-library: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build Message Library + run: | + cd core + ./gradlew -Pversion=${{ inputs.version }} :message-library:build + + - name: Upload Message Library + uses: actions/upload-artifact@v4 + with: + name: message-library-${{ inputs.version }}.jar + path: core/message-library/build/libs/message-library-${{ inputs.version }}.jar + + network-library: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build Network Library + run: | + cd core + ./gradlew -Pversion=${{ inputs.version }} :network-library:build + + - name: Upload Network Library + uses: actions/upload-artifact@v4 + with: + name: network-library-${{ inputs.version }}.jar + path: core/network-library/build/libs/network-library-${{ inputs.version }}.jar + + + client-base: + runs-on: ubuntu-latest + needs: [common, message-library, network-library] + + steps: + + - uses: actions/checkout@v4 + + - name: Download common + uses: actions/download-artifact@v4 + with: + name: common-${{ inputs.version }}.jar + path: client/client-base/libs + + - name: Download message-library + uses: actions/download-artifact@v4 + with: + name: message-library-${{ inputs.version }}.jar + path: client/client-base/libs + + - name: Download network-library + uses: actions/download-artifact@v4 + with: + name: network-library-${{ inputs.version }}.jar + path: client/client-base/libs + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build Client Base + run: | + cd client/client-base + ./gradlew -Pversion=${{ inputs.version }} build + + + - name: Upload Client Base + uses: actions/upload-artifact@v4 + with: + name: client-base-${{ inputs.version }}.jar + path: client/client-base/build/libs/client-base-${{ inputs.version }}.jar + + + bukkit-1-7-10: + runs-on: ubuntu-latest + needs: [client-base] + + steps: + + - uses: actions/checkout@v4 + + - name: Download common + uses: actions/download-artifact@v4 + with: + name: common-${{ inputs.version }}.jar + path: client/bukkit-1.7.10/libs + + - name: Download message-library + uses: actions/download-artifact@v4 + with: + name: message-library-${{ inputs.version }}.jar + path: client/bukkit-1.7.10/libs + + - name: Download network-library + uses: actions/download-artifact@v4 + with: + name: network-library-${{ inputs.version }}.jar + path: client/bukkit-1.7.10/libs + + - name: Download client-base + uses: actions/download-artifact@v4 + with: + name: client-base-${{ inputs.version }}.jar + path: client/bukkit-1.7.10/libs + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + + - name: Build Bukkit 1.7.10 + run: | + cd client/bukkit-1.7.10 + ./gradlew -Pversion=${{ inputs.version }} build + + + - name: Upload Bukkit 1.7.10 + uses: actions/upload-artifact@v4 + with: + name: polychat-bukkit1710-${{ inputs.version }}.jar + path: client/bukkit-1.7.10/build/libs/polychat-bukkit1710-${{ inputs.version }}.jar + + + + bundle-archives: + runs-on: ubuntu-latest + #TODO change this to depend on all the actual mod jars, not client base + needs: [bukkit-1-7-10] + + steps: + #TODO change this to download each actual mod jar, not client base + - name: Download Bukkit 1.7.10 + uses: actions/download-artifact@v4 + with: + name: polychat-bukkit1710-${{ inputs.version }}.jar + path: archives/ + + - name: Cleanup Old Archives + uses: geekyeggo/delete-artifact@v5 + with: + name: | + common-${{ inputs.version }}.jar + client-base-${{ inputs.version }}.jar + message-library-${{ inputs.version }}.jar + network-library-${{ inputs.version }}.jar + + - name: Bundle Archives + id: bundle + if: always() + run: | + cd archives + zip -r ../Polychat-Client-ALL_JARS-${{ inputs.version }}.zip * + + + - name: Upload Archives + uses: actions/upload-artifact@v4 + if: ${{ steps.bundle.conclusion != 'failure' }} + with: + name: Polychat-Client-ALL_JARS-${{ inputs.version }}.zip + path: Polychat-Client-ALL_JARS-${{ inputs.version }}.zip + diff --git a/client/bukkit-1.7.10/build.gradle b/client/bukkit-1.7.10/build.gradle index 5cbcf65..faa914a 100644 --- a/client/bukkit-1.7.10/build.gradle +++ b/client/bukkit-1.7.10/build.gradle @@ -2,7 +2,6 @@ plugins { id 'java-library' } -version "2.0.2" group = 'club.moddedminecraft.polychat.bukkit1710' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'polychat-bukkit1710' diff --git a/client/client-base/build.gradle b/client/client-base/build.gradle index 72e5ca8..776f77d 100644 --- a/client/client-base/build.gradle +++ b/client/client-base/build.gradle @@ -2,8 +2,6 @@ plugins { id 'java' } -version = "2.0.2" - repositories { mavenCentral() flatDir { diff --git a/client/forge-1.19/build.gradle b/client/forge-1.19/build.gradle index d99b1bd..59061f5 100644 --- a/client/forge-1.19/build.gradle +++ b/client/forge-1.19/build.gradle @@ -140,10 +140,10 @@ dependencies { compileOnly("com.google.protobuf:protobuf-java:3.13.0") compileOnly("org.yaml:snakeyaml:1.4+") - jarJar(group: "club.moddedminecraft.polychat.core.messagelibrary", name: "message-library", version: "[2.0.2, 2.0.3)") - jarJar(group: "club.moddedminecraft.polychat.core.networklibrary", name: "network-library", version: "[2.0.2, 2.0.3)") - jarJar(group: "cclub.moddedminecraft.polychat.core.common", name: "common", version: "[2.0.2, 2.0.3)") - jarJar(group: "club.moddedminecraft.polychat.client.clientbase", name: "client-base", version: "[2.0.2, 2.0.3)") + jarJar(group: "club.moddedminecraft.polychat.core.messagelibrary", name: "message-library", version: "${version}") + jarJar(group: "club.moddedminecraft.polychat.core.networklibrary", name: "network-library", version: "${version}") + jarJar(group: "cclub.moddedminecraft.polychat.core.common", name: "common", version: "${version}") + jarJar(group: "club.moddedminecraft.polychat.client.clientbase", name: "client-base", version: "${version}") jarJar(group: "com.google.protobuf", name: "protobuf-java", version: "[3.13, 3.14)") jarJar(group: "org.yaml", name: "snakeyaml", version: "[1.4, 1.5)") diff --git a/client/neoforge-1.21/build.gradle b/client/neoforge-1.21/build.gradle index 14ce27c..12e9113 100644 --- a/client/neoforge-1.21/build.gradle +++ b/client/neoforge-1.21/build.gradle @@ -155,10 +155,10 @@ dependencies { compileOnly("com.google.protobuf:protobuf-java:3.13.0") compileOnly("org.yaml:snakeyaml:2.0") - jarJar(group: "club.moddedminecraft.polychat.core.messagelibrary", name: "message-library", version: "[2.0.2, 2.0.3)") - jarJar(group: "club.moddedminecraft.polychat.core.networklibrary", name: "network-library", version: "[2.0.2, 2.0.3)") - jarJar(group: "cclub.moddedminecraft.polychat.core.common", name: "common", version: "[2.0.2, 2.0.3)") - jarJar(group: "club.moddedminecraft.polychat.client.clientbase", name: "client-base", version: "[2.0.2, 2.0.3)") + jarJar(group: "club.moddedminecraft.polychat.core.messagelibrary", name: "message-library", version: "${version}") + jarJar(group: "club.moddedminecraft.polychat.core.networklibrary", name: "network-library", version: "${version}") + jarJar(group: "cclub.moddedminecraft.polychat.core.common", name: "common", version: "${version}") + jarJar(group: "club.moddedminecraft.polychat.client.clientbase", name: "client-base", version: "${version}") jarJar(group: "com.google.protobuf", name: "protobuf-java", version: "[3.13, 3.14)") jarJar(group: "org.yaml", name: "snakeyaml", version: "[2.0, 2.1)") diff --git a/core/build.gradle b/core/build.gradle index 38b2ff6..0ff1a06 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,5 +1,4 @@ allprojects { - version = "2.0.2" repositories { jcenter() mavenCentral() diff --git a/core/common/build.gradle b/core/common/build.gradle index 7f11877..46d725a 100644 --- a/core/common/build.gradle +++ b/core/common/build.gradle @@ -2,7 +2,7 @@ plugins{ id 'java' } -version = "2.0.2" + dependencies { // Use JUnit test framework diff --git a/core/message-library/build.gradle b/core/message-library/build.gradle index 0b7e3d2..84882cf 100644 --- a/core/message-library/build.gradle +++ b/core/message-library/build.gradle @@ -1,8 +1,6 @@ apply plugin: 'java' apply plugin: 'com.google.protobuf' -version = "2.0.2" - repositories { maven { url "https://plugins.gradle.org/m2/" } } diff --git a/core/network-library/build.gradle b/core/network-library/build.gradle index a124e40..5f06a41 100644 --- a/core/network-library/build.gradle +++ b/core/network-library/build.gradle @@ -2,7 +2,6 @@ plugins{ id 'java' } -version = "2.0.2" dependencies { // Use JUnit test framework