Skip to content

Instantly share code, notes, and snippets.

@u9g
Last active April 15, 2021 12:53
Show Gist options
  • Save u9g/040e11770cb1c739f307e49f0eb33f18 to your computer and use it in GitHub Desktop.
Save u9g/040e11770cb1c739f307e49f0eb33f18 to your computer and use it in GitHub Desktop.
GH Workflow to decompile MC (put both files in .github/workflows/)
name: Dump
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clear old folders
run: rm -Rf client && rm -Rf server
- name: chmod get_latest
run: chmod +x .github/workflows/get_latest.sh
- name: run get_latest
run: .github/workflows/get_latest.sh
shell: bash
- name: Say version
run: echo "Downloading ${{ env.newest_mc }}"
- name: Setup Python
uses: actions/setup-python@v2.2.2
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 1.8
java-package: jre
- name: delete old dump
run: rm -Rf server/ && rm -Rf client/
- name: clone repo
run: git clone https://github.com/u9g/DecompilerMC code && cd code
- name: download & run decompiler
run: |
cd code
python3 main.py --mcversion snap --side server -q
python3 main.py --mcversion snap --side client -q
- name: push final dump to folder
run: |
mkdir client && mkdir server
mv code/src/${{ env.newest_mc }}/client .
mv code/src/${{ env.newest_mc }}/server .
- name: cleanup
run: rm -Rf code/
- name: show structure
run: ls -R
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update to ${{ env.newest_mc }}
#!/bin/bash
wget -qN https://launchermeta.mojang.com/mc/game/version_manifest.json
MCVER=`sed -n -e '/\"latest\"/,/}/ s/.*\"snapshot\": \"\([^\"]*\)\".*/\1/p' < version_manifest.json`
rm -Rf version_manifest.json
echo "newest_mc=$MCVER" >> $GITHUB_ENV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment