Mappings/.github/workflows/main.yml

71 lines
2.3 KiB
YAML
Raw Normal View History

2023-03-04 22:25:57 +01:00
name: Check for new Minecraft snapshot
on:
schedule:
- cron: '10 * * * *'
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2023-03-05 09:40:42 +01:00
with:
persist-credentials: false
fetch-depth: 0
2023-03-04 22:25:57 +01:00
- name: Setup Python
2024-03-18 19:48:59 +01:00
uses: actions/setup-python@v5
2023-03-04 22:25:57 +01:00
2023-10-03 03:46:28 +02:00
- name: Check for snapshot
run: pip install -r requirements.txt && python download_server.py
2023-03-04 22:25:57 +01:00
- name: Setup Java JDK
2024-03-18 19:48:59 +01:00
uses: actions/setup-java@v4
2023-03-04 22:25:57 +01:00
with:
distribution: 'temurin'
2024-04-03 16:07:36 +02:00
java-version: 21
check-latest: true
2023-03-04 22:25:57 +01:00
2023-10-03 03:46:28 +02:00
- name: Validate Gradle Wrapper
2024-08-08 11:03:47 +02:00
uses: gradle/actions/wrapper-validation@v4
2023-03-04 22:25:57 +01:00
# Wooyeah
- name: Read last snapshot
id: last_snapshot
uses: juliangruber/read-file-action@v1
with:
path: ./last_snapshot.txt
- name: Read last release
id: last_release
uses: juliangruber/read-file-action@v1
with:
path: ./last_release.txt
- name: Read next release
id: next_release
uses: juliangruber/read-file-action@v1
with:
path: ./next_release.txt
- name: Compile MappingsGenerator jar
2023-10-03 03:50:29 +02:00
run: ./gradlew build && mv build/libs/MappingsGenerator-*.jar ./MappingsGenerator.jar
2023-03-04 22:25:57 +01:00
- name: Run MappingsGenerator
2023-03-08 16:29:04 +01:00
run: java -jar MappingsGenerator.jar server.jar ${{ steps.next_release.outputs.content }}
2023-03-04 22:25:57 +01:00
- name: Pack mappings
run: java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${{ steps.last_release.outputs.content }} ${{ steps.next_release.outputs.content }} --generateDiffStubs
2023-03-04 22:25:57 +01:00
- name: Pack backwards mappings
run: java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${{ steps.next_release.outputs.content }} ${{ steps.last_release.outputs.content }} --generateDiffStubs
2023-03-04 22:25:57 +01:00
- name: Commit changes
run: |
2023-03-05 09:40:42 +01:00
git config --local user.email "action@github.com"
git config --local user.name "automation"
2023-03-04 22:25:57 +01:00
git add .
2023-03-05 09:40:42 +01:00
git commit -am "Update: ${{ steps.last_snapshot.outputs.content }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN }}
2023-03-08 16:29:04 +01:00
branch: ${{ github.ref }}