Build Polychat Clients #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |