Check for new Minecraft snapshot #15239
This file contains 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: Check for new Minecraft snapshot | |
on: | |
schedule: | |
- cron: '10 * * * *' | |
workflow_dispatch: | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Check for snapshot | |
run: pip install -r requirements.txt && python download_server.py | |
- name: Setup Java JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
check-latest: true | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@v4 | |
# 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: ./gradlew build && mv build/libs/MappingsGenerator-*.jar ./MappingsGenerator.jar | |
- name: Run MappingsGenerator | |
run: java -jar MappingsGenerator.jar server.jar ${{ steps.next_release.outputs.content }} | |
- name: Pack mappings | |
run: java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${{ steps.last_release.outputs.content }} ${{ steps.next_release.outputs.content }} --generateDiffStubs | |
- name: Pack backwards mappings | |
run: java -cp MappingsGenerator.jar com.viaversion.mappingsgenerator.MappingsOptimizer ${{ steps.next_release.outputs.content }} ${{ steps.last_release.outputs.content }} --generateDiffStubs | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "automation" | |
git add . | |
git commit -am "Update: ${{ steps.last_snapshot.outputs.content }}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
branch: ${{ github.ref }} |