Skip to content

Commit

Permalink
yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiyou06 authored Mar 6, 2025
1 parent e2d5498 commit 79e0120
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/build-1214.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ jobs:
BUILD_NUMBER: ${{ github.run_number }}
GRAALVM_ARGS: "-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.LoopUnroll=true -Dgraal.SpeculativeGuardMovement=true --add-modules jdk.incubator.vector"
GRADLE_OPTS: "-Dorg.gradle.parallel=true -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.incremental=true"
GRADLE_MEMORY: "-Xmx4g -XX:MaxMetaspaceSize=2g"
PATCH_PARALLELISM: "16"
outputs:
build_number: ${{ env.BUILD_NUMBER }}
steps:
- name: Checkout repository
uses: actions/checkout@main
with:
fetch-depth: 50

- name: Setup Gradle Cache
uses: useblacksmith/cache@v5
Expand All @@ -25,7 +29,10 @@ jobs:
~/.gradle/caches/jars-*
~/.gradle/caches/transforms-*
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt') }}
# Add patches cache
.gradle/patchCache
.gradle/patched
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt', 'patches/**/*.patch') }}
restore-keys: |
${{ runner.os }}-gradle-
Expand All @@ -50,24 +57,40 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
# Speed up git operations
git config --global core.preloadindex true
git config --global core.fscache true
git config --global gc.auto 256
- name: Configure Gradle Properties
run: |
mkdir -p ~/.gradle
echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties
echo "org.gradle.caching=true" >> ~/.gradle/gradle.properties
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" >> ~/.gradle/gradle.properties
echo "org.gradle.jvmargs=${{ env.GRADLE_MEMORY }} -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" >> ~/.gradle/gradle.properties
echo "kotlin.incremental=true" >> ~/.gradle/gradle.properties
# Add patch parallelism configuration
echo "leafPatches.parallelism=${{ env.PATCH_PARALLELISM }}" >> ~/.gradle/gradle.properties
- name: Apply patches
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" applyAllPatches --stacktrace --no-daemon --parallel
run: |
# Analyze available system resources for optimal settings
echo "CPU cores: $(nproc)"
echo "Memory: $(free -h)"
# Run patch application with optimized settings
./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }} ${{ env.GRADLE_MEMORY }}" \
-Dleaf.patcher.parallelism=${{ env.PATCH_PARALLELISM }} \
applyAllPatches \
--stacktrace --no-daemon --parallel \
--max-workers=8
- name: Create MojmapPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" createMojmapPaperclipJar --stacktrace --no-daemon --parallel
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }} ${{ env.GRADLE_MEMORY }}" createMojmapPaperclipJar --stacktrace --no-daemon --parallel --max-workers=8

- name: Create ReobfPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" -Dpaperweight.debug=true createReobfPaperclipJar --stacktrace --no-daemon --parallel
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }} ${{ env.GRADLE_MEMORY }}" -Dpaperweight.debug=true createReobfPaperclipJar --stacktrace --no-daemon --parallel --max-workers=8

# Start API publishing in background
- name: Start API Publishing
Expand All @@ -79,9 +102,9 @@ jobs:
export REPO_USER=${{ secrets.REPO_USER }}
echo "REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}" >> $GITHUB_ENV
export REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}
./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" publish --parallel > publish_api_log.txt 2>&1
./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }} ${{ env.GRADLE_MEMORY }}" publish --parallel --max-workers=4 > publish_api_log.txt 2>&1
# Uncomment when ready to implement:
# ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true --parallel >> publish_api_log.txt 2>&1
# ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }} ${{ env.GRADLE_MEMORY }}" publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true --parallel >> publish_api_log.txt 2>&1
echo "API_PUBLISH_DONE=true" >> $GITHUB_ENV
) &
Expand Down

0 comments on commit 79e0120

Please sign in to comment.