forked from Runemoro/shortest-path
-
Notifications
You must be signed in to change notification settings - Fork 73
77 lines (63 loc) · 2.24 KB
/
ExtractCollisionMap.yml
File metadata and controls
77 lines (63 loc) · 2.24 KB
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
name: Extract Collision Map
on:
# This workflow is triggered manually or on Wednesdays at 2320 UTC
# This should be after Jagex updates the cache
schedule:
- cron: '20 23 * * 3' # Every Wednesday at 23:20 UTC
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout runelite
uses: actions/checkout@v4
with:
repository: runelite/runelite
path: runelite
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "11"
- name: Get the cache
run: |
./collision-map-update/download-latest-cache.sh
# Replace the following in the key file
# Replace the words "mapsquare" with "region" and "key" with "keys" in the keys.json file
- name: Patch the key file
run: |
sed -i 's/mapsquare/region/g' keys.json
sed -i 's/key/keys/g' keys.json
- name: Insert CollisionMapDumper.java
run: |
cp ./collision-map-update/CollisionMapDumper.java runelite/cache/src/main/java/net/runelite/cache
- name: Patch Runelite with pom file
run: |
cp ./collision-map-update/pom.patch runelite/cache
cd runelite/cache
git apply pom.patch
- name: Build Runelite with Maven
run: |
cd runelite/cache
mvn -B package --file pom.xml -DskipTests
- name: Copy jar file to the root directory
run: |
find runelite/cache/target -name "*-jar-with-dependencies.jar" -exec cp {} ./cache.jar \;
- name: Export collision map
run: |
java -jar cache.jar --cachedir ./cache --xteapath ./keys.json --outputdir "output"
- name: Zip output directory
run: |
cd output
zip -r collision-map.zip .
mv collision-map.zip ../src/main/resources/collision-map.zip
- name: Clean up the directories
run: |
rm -rf runelite cache output cache.jar keys.json cache.zip
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "Update collision map"