-
-
Notifications
You must be signed in to change notification settings - Fork 493
102 lines (90 loc) · 3.37 KB
/
build.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
96
97
98
99
100
101
102
name: Build
on:
push:
branches: [ nextgen ]
pull_request:
branches: [ nextgen ]
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/nextgen'
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setting up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'
- name: Grant permissions to src-theme
run: sudo chmod -R 777 src-theme
- name: Setup and build
uses: gradle/gradle-build-action@v3
env:
CI: true
with:
arguments: genSources build -x test -x detekt
- name: Upload artifact
run: |
function gradleprop {
grep "^${1}=" gradle.properties | cut -d'=' -f2
}
export LB_VERSION=$(gradleprop 'mod_version')
export MINECRAFT_VERSION=$(gradleprop 'minecraft_version')
export LOADER_VERSION=$(gradleprop 'loader_version')
export FABRICAPI_VERSION=$(gradleprop 'fabric_version')
export KOTLIN_VERSION=$(gradleprop 'kotlin_version')
export FABRIC_KOTLIN_VERSION=$(gradleprop 'fabric_kotlin_version')
echo Version: $LB_VERSION, Minecraft: $MINECRAFT_VERSION
cd build/libs
export JAR=$(find . -regex '.*liquidbounce-[0-9.]*\.jar')
cp $JAR zip/liquidbounce.jar
cd zip
zip -r liquidbounce.zip *
md5sum liquidbounce.zip
COMMIT_MESSAGE=$(printf '%s' "${{ github.event.head_commit.message }}" | sed 's/"/\\"/g')
curl --connect-timeout 30 -m 300 -X POST -F "[email protected]" \
-H "Authorization: ${{ secrets.NIGHTLY_PASS }}" \
-F "gh_id=${{ github.event.head_commit.id }}" \
-F "gh_ref=${{ github.ref }}" \
-F "gh_message=${COMMIT_MESSAGE}" \
-F "gh_timestamp=${{ github.event.head_commit.timestamp }}" \
-F "lb_version=$LB_VERSION" \
-F "mc_version=$MINECRAFT_VERSION" \
-F "subsystem=fabric" \
-F "jre_version=21" \
-F "fabric_loader_version=$LOADER_VERSION" \
-F "fabric_api_version=$FABRICAPI_VERSION" \
-F "kotlin_version=$KOTLIN_VERSION" \
-F "fabric_kotlin_version=$FABRIC_KOTLIN_VERSION" \
https://api.liquidbounce.net/api/v1/version/new
verify-pr:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/nextgen'
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setting up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'
- name: Grant permissions to src-theme
run: sudo chmod -R 777 src-theme
- name: Setup and build
uses: gradle/gradle-build-action@v3
env:
CI: true
with:
arguments: genSources build
# Make sure we always run this upload task,
# because the previous step may fail if there are findings.
- name: Upload SARIF to GitHub using the upload-sarif action
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/detekt.sarif