Mappings/.github/workflows/main.yml

72 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@v3
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
uses: actions/setup-python@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Maven
uses: s4u/setup-maven-action@v1.7.0
with:
java-version: 17
- name: Check for snapshot
run: pip install -r requirements.txt && python download_server.py
# 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
run: mvn package && mvn package && mv target/MappingsGenerator-*.jar ./MappingsGenerator.jar
- 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 }}