-
-
Notifications
You must be signed in to change notification settings - Fork 57
95 lines (82 loc) · 4.24 KB
/
build-1214.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Leaf 1.21.4
on:
push:
branches: [ "ver/1.21.4" ]
jobs:
build:
runs-on: blacksmith-8vcpu-ubuntu-2204
env:
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"
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Setup Gradle Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up GraalVM JDK 21
uses: graalvm/setup-graalvm@main
with:
java-version: 21
github-token: "${{ secrets.GITHUB_TOKEN }}"
cache: gradle
set-java-home: true
components: 'native-image'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- 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 "kotlin.incremental=true" >> ~/.gradle/gradle.properties
- name: Apply patches
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" applyAllPatches --stacktrace --no-daemon --parallel
- name: Create MojmapPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" createMojmapPaperclipJar --stacktrace --no-daemon --parallel
- name: Create ReobfPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" -Dpaperweight.debug=true createReobfPaperclipJar --stacktrace --no-daemon --parallel
- name: Rename Paperclip JARs
run: |
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-reobf.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}-reobf.jar
- name: Publish API
continue-on-error: true
run: |
echo "REPO_USER=${{ secrets.REPO_USER }}" >> $GITHUB_ENV
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
# Uncomment when ready to implement:
# ./gradlew -Dorg.gradle.jvmargs="${{ env.GRAALVM_ARGS }}" publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true --parallel
- name: Upload Leaf as build artifact
uses: actions/upload-artifact@main
with:
name: Leaf 1.21.4
path: ./leaf-1.21.4-*.jar
- name: Prepare jar for release
run: mv ./leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar
- name: Release Leaf
# TODO: Replace with a maintained action as marvinpinto/action-automatic-releases is archived
# Recommended alternatives: softprops/action-gh-release or ncipollo/release-action
uses: marvinpinto/action-automatic-releases@master
with:
title: "Leaf 1.21.4"
automatic_release_tag: "ver-1.21.4"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: "./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
prerelease: false