Extract Collision Map #19
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: 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" |