RemotelyMod Cloud #6
This file contains hidden or 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
| name: RemotelyMod Cloud | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| goal: | |
| description: Gradle aggregate task | |
| required: true | |
| type: choice | |
| options: | |
| - buildAllVersions | |
| - publishAllVersions | |
| - publishAllVersionsToModrinth | |
| - publishAllVersionsToCurseForge | |
| - publishAllFabric | |
| - publishAllNeoForge | |
| publish_confirm: | |
| description: Type PUBLISH to upload (uses Modrinth when goal is buildAllVersions) | |
| required: false | |
| type: string | |
| default: '' | |
| remotely_ref: | |
| description: Remotely git ref (blank = workflow branch) | |
| required: false | |
| type: string | |
| default: '' | |
| jobs: | |
| remotelymod: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 480 | |
| env: | |
| ORG_GRADLE_PROJECT_org.gradle.jvmargs: -Xmx8g -Dfile.encoding=UTF-8 | |
| ORG_GRADLE_PROJECT_org.gradle.workers.max: '2' | |
| steps: | |
| - name: Reject publish without confirmation | |
| if: startsWith(inputs.goal, 'publish') && inputs.publish_confirm != 'PUBLISH' | |
| run: | | |
| echo "Publish goals require publish_confirm = PUBLISH" | |
| exit 1 | |
| - name: Checkout Remotely | |
| uses: actions/checkout@v4 | |
| with: | |
| path: Remotely | |
| ref: ${{ inputs.remotely_ref != '' && inputs.remotely_ref || github.ref }} | |
| - name: Checkout ReScreen | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: RedxAx/ReScreen | |
| token: ${{ secrets.REPROJECTS_PAT }} | |
| path: ReScreen | |
| - name: Checkout Remodel | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: RedxAx/Remodel | |
| token: ${{ secrets.REPROJECTS_PAT }} | |
| path: Remodel | |
| - name: Checkout Rebase | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: RedxAx/Rebase | |
| token: ${{ secrets.REPROJECTS_PAT }} | |
| path: Rebase | |
| - name: Ensure Remodel Java 21 toolchain | |
| run: | | |
| chmod +x Remotely/RemotelyMod/scripts/ci-ensure-remodel-java21.sh | |
| Remotely/RemotelyMod/scripts/ci-ensure-remodel-java21.sh Remodel | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Preflight Remotely App jar | |
| working-directory: Remotely | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew jar --no-daemon --stacktrace | |
| - name: Ensure version project directories | |
| working-directory: Remotely/RemotelyMod | |
| run: | | |
| chmod +x scripts/ensure-version-project-dirs.sh | |
| ./scripts/ensure-version-project-dirs.sh | |
| - name: Run RemotelyMod Gradle goal | |
| working-directory: Remotely/RemotelyMod | |
| env: | |
| MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
| CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
| run: | | |
| chmod +x gradlew | |
| goal="${{ inputs.goal }}" | |
| confirm="${{ inputs.publish_confirm }}" | |
| echo "workflow goal=$goal publish_confirm=$confirm" | |
| if [[ "$confirm" == "PUBLISH" && "$goal" == "buildAllVersions" ]]; then | |
| echo "publish_confirm=PUBLISH — running publishAllVersionsToModrinth after build." | |
| goal="publishAllVersionsToModrinth" | |
| fi | |
| if [[ "$goal" == "buildAllVersions" ]]; then | |
| ./gradlew buildAllVersions --no-daemon --stacktrace | |
| elif [[ "$goal" == publish* ]]; then | |
| ./gradlew buildAllVersions "$goal" --no-daemon --stacktrace | |
| else | |
| ./gradlew "$goal" --no-daemon --stacktrace | |
| fi | |
| - name: Upload mod jars | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: remotelymod-versions | |
| path: Remotely/RemotelyMod/build/versions/*.jar | |
| if-no-files-found: error |