update chain doesn't place them properly anymore #460
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: Java CI | |
| on: [ push, release ] | |
| jobs: | |
| buildJar: | |
| name: Build and Publish Jar | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # for Update bundles | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install jq | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Extract Mod Info | |
| id: mod_info | |
| run: | | |
| MOD_DISPLAY_NAME=$(jq -r '.displayName' mod.json) | |
| MOD_DISPLAY_NAME_CLEAN=$(echo "$MOD_DISPLAY_NAME" | tr -d ' ') | |
| DEXED_JAR_NAME="${MOD_DISPLAY_NAME_CLEAN}.jar" | |
| DEXED_JAR_PATH="main/build/libs/${DEXED_JAR_NAME}" | |
| ARTIFACT_NAME="${MOD_DISPLAY_NAME_CLEAN} (in a box)" | |
| echo "dexed_jar_path=${DEXED_JAR_PATH}" >> $GITHUB_OUTPUT | |
| echo "dexed_jar_name=${DEXED_JAR_NAME}" >> $GITHUB_OUTPUT | |
| echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT | |
| echo "mod_display_name_clean=${MOD_DISPLAY_NAME_CLEAN}" >> $GITHUB_OUTPUT | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android SDK Platform 33 and Build Tools | |
| run: | | |
| yes | sdkmanager --licenses > /dev/null || true | |
| sdkmanager "platforms;android-33" "build-tools;33.0.2" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Update bundles | |
| run: | | |
| ./gradlew updateBundles | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git config --global user.name "Github Actions" | |
| git config --global user.email "actions@github.com" | |
| git add main/assets/bundles/* | |
| git commit -m "Automatic bundle update" | |
| git push | |
| fi | |
| - name: Build mod artifact | |
| id: build | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew main:deploy main:dex tools:proc | |
| - name: Upload built mod artifact as a GitHub Action artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.mod_info.outputs.artifact_name }} | |
| path: ${{ steps.mod_info.outputs.dexed_jar_path }} | |
| if-no-files-found: error | |
| compression-level: 0 | |
| - name: Upload built mod artifact into release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.event_name == 'release' && github.event.action == 'created' | |
| with: | |
| files: ${{ steps.mod_info.outputs.dexed_jar_path }} |