main#1582: Add kikiro to sourceSet, handle submodule in action #1582
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
| # 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. | |
| # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
| name: Build and Upload Test Artifact | |
| on: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'buildSrc/**' | |
| - 'patches/**' | |
| - 'projects/**/build.gradle' | |
| - 'build.gradle' | |
| - 'gradle.properties' | |
| - 'script/**' | |
| - '.github/**' | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| build_type: | |
| type: choice | |
| description: Build type | |
| options: | |
| - Stable | |
| - Experimental | |
| run-name: "${{ github.event_name == 'pull_request' && 'Pull Request Build, DO NOT DOWNLOAD' || format('{0}#{1}: {2}', github.ref_name, github.run_number, github.event.commits[0].message)}}" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build and Upload Artifact | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set up JDK 21 | |
| uses: actions/[email protected] | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Get branch name | |
| id: branch-names | |
| uses: tj-actions/[email protected] | |
| - name: Fix Gradle permission | |
| run: chmod +x ./gradlew | |
| - name: Setup Forge env | |
| run: ./gradlew setup -Prun_number=${{ github.run_number }} --info --stacktrace | |
| - name: Stop Gradle daemon | |
| run: ./gradlew --stop | |
| - name: Build Jars | |
| run: ./gradlew build -Prun_number=${{ github.run_number }} | |
| - name: Get version | |
| run: echo "CLEANROOM_VERSION=$(cat version.txt)" >> $GITHUB_ENV | |
| - name: setup python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: '3.13' | |
| - name: Generate MMC Pack | |
| run: python main.py | |
| working-directory: ./script/MMC-Builder | |
| env: | |
| PATH_TO_EXIST_INSTALLER: ../../projects/cleanroom/build/libs/cleanroom-${{ env.CLEANROOM_VERSION }}-installer.jar | |
| BRANCH: ${{ steps.branch-names.outputs.current_branch }} | |
| VERSION: ${{ env.CLEANROOM_VERSION }} | |
| - name: Copy MMC Pack | |
| run: cp script/MMC-Builder/build/CleanroomMMC.zip ./projects/cleanroom/build/libs/Cleanroom-MMC-instance-${{ env.CLEANROOM_VERSION }}.zip | |
| - name: Upload Universal Jar | |
| uses: actions/[email protected] | |
| with: | |
| name: universal-jar-${{ env.CLEANROOM_VERSION }} | |
| path: projects/cleanroom/build/libs/*-universal.jar | |
| - name: Upload Installer Jar | |
| uses: actions/[email protected] | |
| with: | |
| name: installer-jar-${{ env.CLEANROOM_VERSION }} | |
| path: projects/cleanroom/build/libs/*-installer.jar | |
| - name: Upload MMC pack zip | |
| uses: actions/[email protected] | |
| with: | |
| name: mmc-pack-zip-${{ env.CLEANROOM_VERSION }} | |
| path: projects/cleanroom/build/libs/*.zip |